From 7edb3d187540812f1c34624e4840fe13307a50b2 Mon Sep 17 00:00:00 2001 From: Matti Niemenmaa Date: Tue, 9 Mar 2010 23:20:39 +0200 Subject: [PATCH] Don't error out with -singleobj, -of, and -c/-output-{bc,ll,o,s}. --- dmd/module.c | 5 +++-- dmd/module.h | 2 +- gen/main.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dmd/module.c b/dmd/module.c index d59db1f5..8487f63b 100644 --- a/dmd/module.c +++ b/dmd/module.c @@ -219,7 +219,7 @@ static void check_and_add_output_file(Module* NewMod, const std::string& str) files.insert(std::make_pair(str, NewMod)); } -void Module::buildTargetFiles() +void Module::buildTargetFiles(bool singleObj) { if(objfile && (!doDocComment || docfile) && @@ -252,7 +252,8 @@ void Module::buildTargetFiles() // LDC // another safety check to make sure we don't overwrite previous output files - check_and_add_output_file(this, objfile->name->str); + if (!singleObj) + check_and_add_output_file(this, objfile->name->str); if (docfile) check_and_add_output_file(this, docfile->name->str); if (hdrfile) diff --git a/dmd/module.h b/dmd/module.h index 652b07bd..22109d5b 100644 --- a/dmd/module.h +++ b/dmd/module.h @@ -188,7 +188,7 @@ struct Module : Package #if IN_LLVM // LDC llvm::Module* genLLVMModule(llvm::LLVMContext& context, Ir* sir); - void buildTargetFiles(); + void buildTargetFiles(bool singleObj); File* buildFilePath(const char* forcename, const char* path, const char* ext); Module *isModule() { return this; } diff --git a/gen/main.cpp b/gen/main.cpp index 30d398c0..324ccdcd 100644 --- a/gen/main.cpp +++ b/gen/main.cpp @@ -781,7 +781,7 @@ LDC_TARGETS m->importedFrom = m; m->read(0); m->parse(); - m->buildTargetFiles(); + m->buildTargetFiles(singleObj); m->deleteObjFile(); if (m->isDocFile) {