From 12f0babca4459c253675700e1d707652d5b6ba17 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 27 Aug 2009 04:32:07 +0000 Subject: [PATCH] reduce header #include'age git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80204 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Transforms/IPO/InlinerPass.h | 18 +++++++++--------- include/llvm/Transforms/Utils/InlineCost.h | 3 ++- lib/Transforms/IPO/Inliner.cpp | 5 ++++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/include/llvm/Transforms/IPO/InlinerPass.h b/include/llvm/Transforms/IPO/InlinerPass.h index e8a86946678..36c7445c794 100644 --- a/include/llvm/Transforms/IPO/InlinerPass.h +++ b/include/llvm/Transforms/IPO/InlinerPass.h @@ -14,16 +14,17 @@ // //===----------------------------------------------------------------------===// -#ifndef INLINER_H -#define INLINER_H +#ifndef LLVM_TRANSFORMS_IPO_INLINERPASS_H +#define LLVM_TRANSFORMS_IPO_INLINERPASS_H #include "llvm/CallGraphSCCPass.h" -#include "llvm/Transforms/Utils/InlineCost.h" - namespace llvm { class CallSite; class TargetData; + class InlineCost; + template + class SmallPtrSet; /// Inliner - This class contains all of the helper code which is used to /// perform the inlining operations that do not depend on the policy. @@ -45,11 +46,6 @@ struct Inliner : public CallGraphSCCPass { // processing to avoid breaking the SCC traversal. virtual bool doFinalization(CallGraph &CG); - // InlineCallIfPossible - bool InlineCallIfPossible(CallSite CS, CallGraph &CG, - const SmallPtrSet &SCCFunctions, - const TargetData *TD); - /// This method returns the value specified by the -inline-threshold value, /// specified on the command line. This is typically not directly needed. /// @@ -83,6 +79,10 @@ private: /// shouldInline - Return true if the inliner should attempt to /// inline at the given CallSite. bool shouldInline(CallSite CS); + + bool InlineCallIfPossible(CallSite CS, CallGraph &CG, + const SmallPtrSet &SCCFunctions, + const TargetData *TD); }; } // End llvm namespace diff --git a/include/llvm/Transforms/Utils/InlineCost.h b/include/llvm/Transforms/Utils/InlineCost.h index f275b760824..2d0c397227b 100644 --- a/include/llvm/Transforms/Utils/InlineCost.h +++ b/include/llvm/Transforms/Utils/InlineCost.h @@ -14,7 +14,6 @@ #ifndef LLVM_TRANSFORMS_UTILS_INLINECOST_H #define LLVM_TRANSFORMS_UTILS_INLINECOST_H -#include "llvm/ADT/SmallPtrSet.h" #include #include #include @@ -25,6 +24,8 @@ namespace llvm { class Value; class Function; class CallSite; + template + class SmallPtrSet; /// InlineCost - Represent the cost of inlining a function. This /// supports special values for functions which should "always" or diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index af7270a0484..965849cc4f8 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -21,10 +21,12 @@ #include "llvm/Support/CallSite.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/IPO/InlinerPass.h" +#include "llvm/Transforms/Utils/InlineCost.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" #include using namespace llvm; @@ -57,7 +59,8 @@ bool Inliner::InlineCallIfPossible(CallSite CS, CallGraph &CG, Function *Callee = CS.getCalledFunction(); Function *Caller = CS.getCaller(); - if (!InlineFunction(CS, &CG, TD)) return false; + if (!InlineFunction(CS, &CG, TD)) + return false; // If the inlined function had a higher stack protection level than the // calling function, then bump up the caller's stack protection level. -- 2.34.1