From 40add594ebb8701fc43f0eb77d296f9b7ea0a5d4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 3 Dec 2004 05:45:58 +0000 Subject: [PATCH] Add -strip-debug option remove the temporary -disable-dse option git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18451 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/gccas/gccas.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/gccas/gccas.cpp b/tools/gccas/gccas.cpp index dd8b8e06984..ef1d8d6376d 100644 --- a/tools/gccas/gccas.cpp +++ b/tools/gccas/gccas.cpp @@ -48,7 +48,9 @@ namespace { cl::desc("Do not run any optimization passes")); cl::opt - DisableDSE("disable-dse", cl::desc("Do not run dead store elimination")); + StripDebug("strip-debug", + cl::desc("Strip debugger symbol info from translation unit")); + cl::opt NoCompress("disable-compression", cl::init(false), cl::desc("Don't ompress the generated bytecode")); @@ -66,9 +68,14 @@ static inline void addPass(PassManager &PM, Pass *P) { 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 the -strip-debug command line option was specified, do it. + if (StripDebug) + addPass(PM, createStripSymbolsPass(true)); + if (DisableOptimizations) return; addPass(PM, createRaiseAllocationsPass()); // call %malloc -> malloc inst @@ -109,8 +116,7 @@ void AddConfiguredTransformationPasses(PassManager &PM) { // Run instcombine after redundancy elimination to exploit opportunities // opened up by them. addPass(PM, createInstructionCombiningPass()); - if (!DisableDSE) - addPass(PM, createDeadStoreEliminationPass()); // Delete dead stores + addPass(PM, createDeadStoreEliminationPass()); // Delete dead stores addPass(PM, createAggressiveDCEPass()); // SSA based 'Aggressive DCE' addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs addPass(PM, createDeadTypeEliminationPass()); // Eliminate dead types