mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 01:20:51 +03:00
Replace global.params.singleObj by global.params.oneobj
singleObj was LDC-specific.
This commit is contained in:
parent
94d607acb2
commit
c748eb9ed0
6 changed files with 5 additions and 18 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
13
ddmd/mars.d
13
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();
|
||||
}
|
||||
|
|
|
@ -382,7 +382,7 @@ static cl::opt<MultiSetter, true, cl::parser<bool>>
|
|||
|
||||
cl::opt<bool, true>
|
||||
singleObj("singleobj", cl::desc("Create only a single output object file"),
|
||||
cl::location(global.params.singleObj));
|
||||
cl::location(global.params.oneobj));
|
||||
|
||||
cl::opt<uint32_t, true> hashThreshold(
|
||||
"hash-threshold",
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue