# HG changeset patch # User Matti Niemenmaa # Date 1268169639 -7200 # Node ID 1d2d1aa1684170747895010a3d3759efebb8d104 # Parent 9176437d98be449157a774a8af5ca60a117f9b8d Don't error out with -singleobj, -of, and -c/-output-{bc,ll,o,s}. diff -r 9176437d98be -r 1d2d1aa16841 dmd/module.c --- a/dmd/module.c Tue Mar 09 23:07:08 2010 +0200 +++ b/dmd/module.c Tue Mar 09 23:20:39 2010 +0200 @@ -219,7 +219,7 @@ files.insert(std::make_pair(str, NewMod)); } -void Module::buildTargetFiles() +void Module::buildTargetFiles(bool singleObj) { if(objfile && (!doDocComment || docfile) && @@ -252,7 +252,8 @@ // 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 -r 9176437d98be -r 1d2d1aa16841 dmd/module.h --- a/dmd/module.h Tue Mar 09 23:07:08 2010 +0200 +++ b/dmd/module.h Tue Mar 09 23:20:39 2010 +0200 @@ -188,7 +188,7 @@ #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 -r 9176437d98be -r 1d2d1aa16841 gen/main.cpp --- a/gen/main.cpp Tue Mar 09 23:07:08 2010 +0200 +++ b/gen/main.cpp Tue Mar 09 23:20:39 2010 +0200 @@ -781,7 +781,7 @@ m->importedFrom = m; m->read(0); m->parse(); - m->buildTargetFiles(); + m->buildTargetFiles(singleObj); m->deleteObjFile(); if (m->isDocFile) {