diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-28 05:49:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-28 05:49:45 +0000 |
commit | 7bf5dfec1924e150bf9aa7745c9f98102b8e1a52 (patch) | |
tree | b3b89bc1e16b523ac81e8ab5f151c978a0983727 | |
parent | 100d6daca4e6b762735b32bb2a00ee32945e2a82 (diff) | |
download | external_llvm-7bf5dfec1924e150bf9aa7745c9f98102b8e1a52.zip external_llvm-7bf5dfec1924e150bf9aa7745c9f98102b8e1a52.tar.gz external_llvm-7bf5dfec1924e150bf9aa7745c9f98102b8e1a52.tar.bz2 |
Run the internalize pass to mark all functions except main internal when
linking the final program to allow smarter optimizations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2364 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/gccld/gccld.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp index 1e16aa1..8d78305 100644 --- a/tools/gccld/gccld.cpp +++ b/tools/gccld/gccld.cpp @@ -23,6 +23,7 @@ #include "llvm/Transforms/CleanupGCCOutput.h" #include "llvm/Transforms/ConstantMerge.h" #include "llvm/Transforms/IPO/GlobalDCE.h" +#include "llvm/Transforms/IPO/Internalize.h" #include "Support/CommandLine.h" #include "Support/Signals.h" #include <fstream> @@ -81,8 +82,6 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) { } - - int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n", cl::EnableSingleLetterArgValue | @@ -148,7 +147,7 @@ int main(int argc, char **argv) { // Now that composite has been compiled, scan through the module, looking for // a main function. If main is defined, mark all other functions internal. // - // TODO: + Passes.add(createInternalizePass()); // Now that we have optimized the program, discard unreachable functions... // |