Ignore -enable-cross-module-inlining if inlining is generally disabled (#3664)

People use `dflags "-enable-cross-module-inlining" platform="ldc"`
in their dub.sdl files; default and debug builds without -O thus
incur a superfluous compile-time cost for no benefit.
This commit is contained in:
Martin Kinkelin 2021-02-13 00:09:01 +01:00 committed by GitHub
parent 8d71c8624a
commit 98a066ea30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 11 deletions

View file

@ -128,7 +128,7 @@ bool willInline() {
}
bool willCrossModuleInline() {
return enableCrossModuleInlining == llvm::cl::BOU_TRUE;
return enableCrossModuleInlining == llvm::cl::BOU_TRUE && willInline();
}
#if LDC_LLVM_VER >= 800 && LDC_LLVM_VER < 1000