mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Always run SimplifyCFG to workaround LLVM bug 2613.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user