aboutsummaryrefslogtreecommitdiff
path: root/tools/gccld/GenerateCode.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-02 21:26:10 +0000
committerChris Lattner <sabre@nondot.org>2004-12-02 21:26:10 +0000
commit3f14fb1a0b3fac070714caa82bf938c410bbe232 (patch)
treeba857791ca3f57e59361ea8b82419d23961aa998 /tools/gccld/GenerateCode.cpp
parente3ad43c828280cf11e8631f1a814a51a0b168016 (diff)
Recognize --strip-all as a synonym for -s.
Add -S and --strip-debug option support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld/GenerateCode.cpp')
-rw-r--r--tools/gccld/GenerateCode.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp
index f22319df5b..84eba1b505 100644
--- a/tools/gccld/GenerateCode.cpp
+++ b/tools/gccld/GenerateCode.cpp
@@ -130,13 +130,14 @@ static inline void addPass(PassManager &PM, Pass *P) {
///
/// Inputs:
/// M - The module for which bytecode should be generated.
-/// Strip - Flags whether symbols should be stripped from the output.
+/// StripLevel - 2 if we should strip all symbols, 1 if we should strip
+/// debug info.
/// Internalize - Flags whether all symbols should be marked internal.
/// Out - Pointer to file stream to which to write the output.
///
/// Returns non-zero value on error.
///
-int llvm::GenerateBytecode(Module *M, bool Strip, bool Internalize,
+int llvm::GenerateBytecode(Module *M, int StripLevel, bool Internalize,
std::ostream *Out) {
// In addition to just linking the input from GCC, we also want to spiff it up
// a little bit. Do this now.
@@ -208,11 +209,11 @@ int llvm::GenerateBytecode(Module *M, bool Strip, bool Internalize,
addPass(Passes, createGlobalDCEPass());
}
- // If the -s command line option was specified, strip the symbols out of the
- // resulting program to make it smaller. -s is a GCC option that we are
- // supporting.
- if (Strip)
- addPass(Passes, createSymbolStrippingPass());
+ // If the -s or -S command line options were specified, strip the symbols out
+ // of the resulting program to make it smaller. -s and -S are GLD options
+ // that we are supporting.
+ if (StripLevel)
+ addPass(Passes, createStripSymbolsPass(StripLevel == 1));
// Make sure everything is still good.
Passes.add(createVerifierPass());