Turn on the inliner by default at link-time
authorChris Lattner <sabre@nondot.org>
Fri, 24 Oct 2003 18:09:23 +0000 (18:09 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 24 Oct 2003 18:09:23 +0000 (18:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9477 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gccld/GenerateCode.cpp

index ef072877314a6c78754cb6c783e049bd88ca893c..26b115f26290190991c301b2dfb6571a82c33677 100644 (file)
 #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());