summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitb1e8187c310ca4ad466dcd3de56365177473b267 (patch)
tree9867097f96d444dc6d4423146ca0faefac5203e0 /llvm/tools/gccld/GenerateCode.cpp
parent084a3a07731e254295e2909062510603c37ee82a (diff)
downloadbcm5719-llvm-b1e8187c310ca4ad466dcd3de56365177473b267.tar.gz
bcm5719-llvm-b1e8187c310ca4ad466dcd3de56365177473b267.zip
Turn on the inliner by default at link-time
llvm-svn: 9477
Diffstat (limited to 'llvm/tools/gccld/GenerateCode.cpp')
-rw-r--r--llvm/tools/gccld/GenerateCode.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/tools/gccld/GenerateCode.cpp b/llvm/tools/gccld/GenerateCode.cpp
index ef072877314..26b115f2629 100644
--- a/llvm/tools/gccld/GenerateCode.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud