aboutsummaryrefslogtreecommitdiff
path: root/tools/gccld/GenerateCode.cpp
diff options
context:
space:
mode:
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());