aboutsummaryrefslogtreecommitdiff
path: root/tools/gccld/GenerateCode.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-24 18:09:23 +0000
committerChris Lattner <sabre@nondot.org>2003-10-24 18:09:23 +0000
commit246ce3c2d5a00abc56e6599d86dfc01c70925601 (patch)
tree7cdcdb5671401bfdfced065f14bafa97b375cf06 /tools/gccld/GenerateCode.cpp
parent3896be2ecdcef019a10f3f4a43e5e2de3e3a2cf6 (diff)
Turn on the inliner by default at link-time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld/GenerateCode.cpp')
-rw-r--r--tools/gccld/GenerateCode.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp
index ef07287731..26b115f262 100644
--- a/tools/gccld/GenerateCode.cpp
+++ b/tools/gccld/GenerateCode.cpp
@@ -22,6 +22,13 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Linker.h"
#include "Support/SystemUtils.h"
+#include "Support/CommandLine.h"
+
+namespace {
+ cl::opt<bool>
+ DisableInline("disable-inlining", cl::desc("Do not run the inliner pass"));
+}
+
/// GenerateBytecode - generates a bytecode file from the specified module.
///
@@ -74,6 +81,9 @@ GenerateBytecode (Module *M, bool Strip, bool Internalize, std::ostream *Out) {
// Remove unused arguments from functions...
Passes.add(createDeadArgEliminationPass());
+ if (!DisableInline)
+ Passes.add(createFunctionInliningPass()); // Inline small functions
+
// The FuncResolve pass may leave cruft around if functions were prototyped
// differently than they were defined. Remove this cruft.
Passes.add(createInstructionCombiningPass());