mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Update to work with LLVM 2.7.
Removed use of dyn_cast, llvm no compiles without exceptions and rtti by default. We do need exceptions for the libconfig stuff, but rtti isn't necessary (anymore). Debug info needs to be rewritten, as in LLVM 2.7 the format has completely changed. To have something to look at while rewriting, the old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means that you have to define this to compile at the moment. Updated tango 0.99.9 patch to include updated EH runtime code, which is needed for LLVM 2.7 as well.
This commit is contained in:
@@ -95,7 +95,7 @@ bool optimize() {
|
||||
|
||||
static void addPass(PassManager& pm, Pass* pass) {
|
||||
pm.add(pass);
|
||||
|
||||
|
||||
if (verifyEach) pm.add(createVerifierPass());
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ static void addPassesForOptLevel(PassManager& pm) {
|
||||
{
|
||||
//addPass(pm, createStripDeadPrototypesPass());
|
||||
addPass(pm, createGlobalDCEPass());
|
||||
addPass(pm, createRaiseAllocationsPass());
|
||||
addPass(pm, createPromoteMemoryToRegisterPass());
|
||||
addPass(pm, createCFGSimplificationPass());
|
||||
if (optimizeLevel == 1)
|
||||
addPass(pm, createPromoteMemoryToRegisterPass());
|
||||
@@ -165,7 +165,7 @@ static void addPassesForOptLevel(PassManager& pm) {
|
||||
addPass(pm, createCFGSimplificationPass());
|
||||
addPass(pm, createInstructionCombiningPass());
|
||||
}
|
||||
|
||||
|
||||
// -O3
|
||||
if (optimizeLevel >= 3)
|
||||
{
|
||||
@@ -177,7 +177,7 @@ static void addPassesForOptLevel(PassManager& pm) {
|
||||
addPass(pm, createCFGSimplificationPass());
|
||||
addPass(pm, createScalarReplAggregatesPass());
|
||||
addPass(pm, createInstructionCombiningPass());
|
||||
addPass(pm, createCondPropagationPass());
|
||||
addPass(pm, createConstantPropagationPass());
|
||||
|
||||
addPass(pm, createReassociatePass());
|
||||
addPass(pm, createLoopRotatePass());
|
||||
@@ -194,7 +194,7 @@ static void addPassesForOptLevel(PassManager& pm) {
|
||||
addPass(pm, createSCCPPass());
|
||||
|
||||
addPass(pm, createInstructionCombiningPass());
|
||||
addPass(pm, createCondPropagationPass());
|
||||
addPass(pm, createConstantPropagationPass());
|
||||
|
||||
addPass(pm, createDeadStoreEliminationPass());
|
||||
addPass(pm, createAggressiveDCEPass());
|
||||
@@ -220,9 +220,9 @@ bool ldc_optimize_module(llvm::Module* m)
|
||||
return false;
|
||||
|
||||
PassManager pm;
|
||||
|
||||
|
||||
if (verifyEach) pm.add(createVerifierPass());
|
||||
|
||||
|
||||
addPass(pm, new TargetData(m));
|
||||
|
||||
bool optimize = optimizeLevel != 0 || doInline();
|
||||
|
||||
Reference in New Issue
Block a user