mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 09:31:03 +03:00
Always run SimplifyCFG to workaround LLVM bug 2613.
This commit is contained in:
parent
be85b09854
commit
d82c8068a3
1 changed files with 7 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
|||
#include "llvm/Module.h"
|
||||
#include "llvm/ModuleProvider.h"
|
||||
#include "llvm/PassManager.h"
|
||||
#include "llvm/LinkAllPasses.h"
|
||||
#include "llvm/System/Program.h"
|
||||
#include "llvm/System/Path.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
@ -162,6 +163,12 @@ void Module::genobjfile(int multiobj, char** envp)
|
|||
}
|
||||
}
|
||||
|
||||
// always run this pass to eliminate dead code that breaks debug info
|
||||
llvm::PassManager pm;
|
||||
pm.add(new llvm::TargetData(ir.module));
|
||||
pm.add(llvm::createCFGSimplificationPass());
|
||||
pm.run(*ir.module);
|
||||
|
||||
// run optimizer
|
||||
ldc_optimize_module(ir.module, global.params.optimizeLevel, global.params.llvmInline);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue