mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-29 14:40:40 +03:00
optimizer: Do not disable codegen opt if -g is given
It has been a long time since this actually caused problems. If some start to show up again, we should preferrably come up with a local fix instead of globally disable everything (which is horrible for -O3 -g builds).
This commit is contained in:
parent
04ab1c2441
commit
75b3270a19
1 changed files with 6 additions and 8 deletions
|
@ -140,16 +140,14 @@ bool willInline() {
|
|||
bool isOptimizationEnabled() { return optimizeLevel != 0; }
|
||||
|
||||
llvm::CodeGenOpt::Level codeGenOptLevel() {
|
||||
const int opt = optLevel();
|
||||
// Use same appoach as clang (see lib/CodeGen/BackendUtil.cpp)
|
||||
llvm::CodeGenOpt::Level codeGenOptLevel = llvm::CodeGenOpt::Default;
|
||||
// Debug info doesn't work properly with CodeGenOpt <> None
|
||||
if (global.params.symdebug || !opt) {
|
||||
codeGenOptLevel = llvm::CodeGenOpt::None;
|
||||
} else if (opt >= 3) {
|
||||
codeGenOptLevel = llvm::CodeGenOpt::Aggressive;
|
||||
if (optLevel() == 0) {
|
||||
return llvm::CodeGenOpt::None;
|
||||
}
|
||||
return codeGenOptLevel;
|
||||
if (optLevel() >= 3) {
|
||||
return llvm::CodeGenOpt::Aggressive;
|
||||
}
|
||||
return llvm::CodeGenOpt::Default;
|
||||
}
|
||||
|
||||
static inline void addPass(PassManagerBase &pm, Pass *pass) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue