From: Chris Lattner Date: Fri, 24 Oct 2003 18:09:23 +0000 (+0000) Subject: Turn on the inliner by default at link-time X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=246ce3c2d5a00abc56e6599d86dfc01c70925601;p=oota-llvm.git 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 --- diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp index ef072877314..26b115f2629 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 + 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());