remove isRuntimeCompileEnabled() function

This commit is contained in:
Ivan 2017-10-15 23:24:36 +03:00
parent 9633eca239
commit afae2f296b
5 changed files with 7 additions and 8 deletions

View file

@ -124,9 +124,8 @@ extern cl::opt<std::string> dcomputeFilePrefix;
#if defined(LDC_RUNTIME_COMPILE) #if defined(LDC_RUNTIME_COMPILE)
extern cl::opt<bool> enableRuntimeCompile; extern cl::opt<bool> enableRuntimeCompile;
inline bool isRuntimeCompileEnabled() { return enableRuntimeCompile; }
#else #else
inline bool isRuntimeCompileEnabled() { return false; } constexpr bool enableRuntimeCompile = false;
#endif #endif
} }
#endif #endif

View file

@ -341,7 +341,7 @@ void ArgsBuilder::build(llvm::StringRef outputPath,
args.push_back("-lldc-profile-rt"); args.push_back("-lldc-profile-rt");
} }
if (opts::isRuntimeCompileEnabled()) { if (opts::enableRuntimeCompile) {
args.push_back("-lldc-jit-rt"); args.push_back("-lldc-jit-rt");
args.push_back("-lldc-jit"); args.push_back("-lldc-jit");
} }

View file

@ -118,7 +118,7 @@ int linkObjToBinaryMSVC(llvm::StringRef outputPath, bool useInternalLinker,
args.push_back("ws2_32.lib"); args.push_back("ws2_32.lib");
} }
if (opts::isRuntimeCompileEnabled()) { if (opts::enableRuntimeCompile) {
args.push_back("ldc-jit-rt.lib"); args.push_back("ldc-jit-rt.lib");
args.push_back("ldc-jit.lib"); args.push_back("ldc-jit.lib");
} }

View file

@ -920,7 +920,7 @@ void registerPredefinedVersions() {
// `D_ObjectiveC` is added by the ddmd.objc.Supported ctor // `D_ObjectiveC` is added by the ddmd.objc.Supported ctor
if (opts::isRuntimeCompileEnabled()) { if (opts::enableRuntimeCompile) {
VersionCondition::addPredefinedGlobalIdent("LDC_RuntimeCompilation"); VersionCondition::addPredefinedGlobalIdent("LDC_RuntimeCompilation");
} }

View file

@ -648,7 +648,7 @@ void declareRuntimeCompiledFunction(IRState *irs, IrFunction *func) {
assert(nullptr != irs); assert(nullptr != irs);
assert(nullptr != func); assert(nullptr != func);
assert(nullptr != func->getLLVMFunc()); assert(nullptr != func->getLLVMFunc());
if (!opts::isRuntimeCompileEnabled()) { if (!opts::enableRuntimeCompile) {
return; return;
} }
auto srcFunc = func->getLLVMFunc(); auto srcFunc = func->getLLVMFunc();
@ -665,7 +665,7 @@ void defineRuntimeCompiledFunction(IRState *irs, IrFunction *func)
assert(nullptr != func); assert(nullptr != func);
assert(nullptr != func->getLLVMFunc()); assert(nullptr != func->getLLVMFunc());
assert(nullptr != func->rtCompileFunc); assert(nullptr != func->rtCompileFunc);
if (!opts::isRuntimeCompileEnabled()) { if (!opts::enableRuntimeCompile) {
return; return;
} }
auto srcFunc = func->getLLVMFunc(); auto srcFunc = func->getLLVMFunc();
@ -688,7 +688,7 @@ void addRuntimeCompiledVar(IRState *irs, IrGlobal *var) {
assert(nullptr != var); assert(nullptr != var);
assert(nullptr != var->value); assert(nullptr != var->value);
assert(nullptr != var->V); assert(nullptr != var->V);
if (!opts::isRuntimeCompileEnabled()) { if (!opts::enableRuntimeCompile) {
return; return;
} }