mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-11 09:23:13 +01:00
Don't error out with -singleobj, -of, and -c/-output-{bc,ll,o,s}.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -781,7 +781,7 @@ LDC_TARGETS
|
||||
m->importedFrom = m;
|
||||
m->read(0);
|
||||
m->parse();
|
||||
m->buildTargetFiles();
|
||||
m->buildTargetFiles(singleObj);
|
||||
m->deleteObjFile();
|
||||
if (m->isDocFile)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user