Don't error out with -singleobj, -of, and -c/-output-{bc,ll,o,s}.

This commit is contained in:
Matti Niemenmaa
2010-03-09 23:20:39 +02:00
parent 68daadf53c
commit 7edb3d1875
3 changed files with 5 additions and 4 deletions

View File

@@ -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)

View File

@@ -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; }

View File

@@ -781,7 +781,7 @@ LDC_TARGETS
m->importedFrom = m;
m->read(0);
m->parse();
m->buildTargetFiles();
m->buildTargetFiles(singleObj);
m->deleteObjFile();
if (m->isDocFile)
{