diff --git a/ddmd/globals.d b/ddmd/globals.d index 80de76cdab..7ac7f3d999 100644 --- a/ddmd/globals.d +++ b/ddmd/globals.d @@ -216,7 +216,6 @@ struct Param const(void)* targetTriple; // const llvm::Triple* // Codegen cl options - bool singleObj; bool disableRedZone; uint hashThreshold; // MD5 hash symbols larger than this threshold (0 = no hashing) diff --git a/ddmd/globals.h b/ddmd/globals.h index a115a1f37f..64ce2dafad 100644 --- a/ddmd/globals.h +++ b/ddmd/globals.h @@ -214,7 +214,6 @@ struct Param const llvm::Triple *targetTriple; // Codegen cl options - bool singleObj; bool disableRedZone; uint32_t hashThreshold; // MD5 hash symbols larger than this threshold (0 = no hashing) diff --git a/ddmd/mars.d b/ddmd/mars.d index 1e97bbf8d7..d2558abf79 100644 --- a/ddmd/mars.d +++ b/ddmd/mars.d @@ -1404,13 +1404,6 @@ extern (C++) int mars_mainBody(ref Strings files, ref Strings libmodules) if (!Module.rootModule) Module.rootModule = m; m.importedFrom = m; // m->isRoot() == true - version (IN_LLVM) - { - m.parse(); - m.deleteObjFile(); - } - else - { if (!global.params.oneobj || modi == 0 || m.isDocFile) m.deleteObjFile(); static if (ASYNCREAD) @@ -1422,7 +1415,6 @@ extern (C++) int mars_mainBody(ref Strings files, ref Strings libmodules) } } m.parse(); - } if (m.isDocFile) { anydocfiles = true; @@ -1640,7 +1632,7 @@ extern (C++) int mars_mainBody(ref Strings files, ref Strings libmodules) if (global.params.run) m.makeObjectFilenameUnique(); - if (!global.params.singleObj) + if (!global.params.oneobj || i == 0) m.checkAndAddOutputFile(m.objfile); } @@ -1732,11 +1724,8 @@ extern (C++) int mars_mainBody(ref Strings files, ref Strings libmodules) for (size_t i = 0; i < modules.dim; i++) { modules[i].deleteObjFile(); - version (IN_LLVM) {} else - { if (global.params.oneobj) break; - } } deleteExeFile(); } diff --git a/driver/cl_options.cpp b/driver/cl_options.cpp index 23c13e9c55..824e63ee02 100644 --- a/driver/cl_options.cpp +++ b/driver/cl_options.cpp @@ -382,7 +382,7 @@ static cl::opt> cl::opt singleObj("singleobj", cl::desc("Create only a single output object file"), - cl::location(global.params.singleObj)); + cl::location(global.params.oneobj)); cl::opt hashThreshold( "hash-threshold", diff --git a/driver/codegenerator.cpp b/driver/codegenerator.cpp index b1e696fc75..e5d9edf310 100644 --- a/driver/codegenerator.cpp +++ b/driver/codegenerator.cpp @@ -133,7 +133,7 @@ void CodeGenerator::prepareLLModule(Module *m) { #endif // TODO: Make ldc::DIBuilder per-Module to be able to emit several CUs for - // singleObj compilations? + // single-object compilations? ir_->DBuilder.EmitCompileUnit(m); IrDsymbol::resetAll(); diff --git a/driver/main.cpp b/driver/main.cpp index 6d919c703f..7744e6ee5a 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -653,7 +653,7 @@ static void parseCommandLine(int argc, char **argv, Strings &sourceFiles, } else if (global.params.run) { error(Loc(), "flags conflict with -run"); } else if (global.params.objname && sourceFiles.dim > 1) { - if (!(global.params.lib || global.params.dll) && !singleObj) { + if (!(global.params.lib || global.params.dll) && !global.params.oneobj) { error(Loc(), "multiple source files, but only one .obj name"); } } @@ -1117,7 +1117,7 @@ int cppmain(int argc, char **argv) { void codegenModules(Modules &modules) { // Generate one or more object/IR/bitcode files. if (global.params.obj && !modules.empty()) { - ldc::CodeGenerator cg(getGlobalContext(), singleObj); + ldc::CodeGenerator cg(getGlobalContext(), global.params.oneobj); // When inlining is enabled, we are calling semantic3 on function // declarations, which may _add_ members to the first module in the modules