aboutsummaryrefslogtreecommitdiff
path: root/tools/gccas/gccas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gccas/gccas.cpp')
-rw-r--r--tools/gccas/gccas.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/gccas/gccas.cpp b/tools/gccas/gccas.cpp
index 40abcca5d6..356bc8216a 100644
--- a/tools/gccas/gccas.cpp
+++ b/tools/gccas/gccas.cpp
@@ -42,6 +42,10 @@ namespace {
cl::opt<bool>
DisableInline("disable-inlining", cl::desc("Do not run the inliner pass"));
+
+ cl::opt<bool>
+ DisableOptimizations("disable-opt",
+ cl::desc("Do not run any optimization passes"));
}
@@ -58,6 +62,9 @@ void AddConfiguredTransformationPasses(PassManager &PM) {
PM.add(createVerifierPass()); // Verify that input is correct
addPass(PM, createLowerSetJmpPass()); // Lower llvm.setjmp/.longjmp
addPass(PM, createFunctionResolvingPass()); // Resolve (...) functions
+
+ if (DisableOptimizations) return;
+
addPass(PM, createCFGSimplificationPass()); // Clean up disgusting code
addPass(PM, createRaiseAllocationsPass()); // call %malloc -> malloc inst
addPass(PM, createGlobalDCEPass()); // Remove unused globals