aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-01-21 11:39:16 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-01-21 11:39:16 +0000
commit0378e3916a3d568ee161803d4f0107512e595af8 (patch)
tree84dace69aa82f7e0cc4a46d89907fa93a2ac82a7 /lib/Transforms/IPO
parent5a47127c4c1aeed8a4caac5bcd25301eb69bd461 (diff)
Formatting and comment fixes to the always inliner.
Formatting fixes brought to you by clang-format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/InlineAlways.cpp53
1 files changed, 28 insertions, 25 deletions
diff --git a/lib/Transforms/IPO/InlineAlways.cpp b/lib/Transforms/IPO/InlineAlways.cpp
index 29718034b4..5937fab472 100644
--- a/lib/Transforms/IPO/InlineAlways.cpp
+++ b/lib/Transforms/IPO/InlineAlways.cpp
@@ -30,29 +30,34 @@ using namespace llvm;
namespace {
- // AlwaysInliner only inlines functions that are mark as "always inline".
- class AlwaysInliner : public Inliner {
- InlineCostAnalyzer CA;
- public:
- // Use extremely low threshold.
- AlwaysInliner() : Inliner(ID, -2000000000, /*InsertLifetime*/true) {
- initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry());
- }
- AlwaysInliner(bool InsertLifetime) : Inliner(ID, -2000000000,
- InsertLifetime) {
- initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry());
- }
- static char ID; // Pass identification, replacement for typeid
- virtual InlineCost getInlineCost(CallSite CS);
-
- using llvm::Pass::doInitialization;
- using llvm::Pass::doFinalization;
-
- virtual bool doFinalization(CallGraph &CG) {
- return removeDeadFunctions(CG, /*AlwaysInlineOnly=*/true);
- }
- virtual bool doInitialization(CallGraph &CG);
- };
+/// \brief Inliner pass which only handles "always inline" functions.
+class AlwaysInliner : public Inliner {
+ InlineCostAnalyzer CA;
+
+public:
+ // Use extremely low threshold.
+ AlwaysInliner() : Inliner(ID, -2000000000, /*InsertLifetime*/ true) {
+ initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry());
+ }
+
+ AlwaysInliner(bool InsertLifetime)
+ : Inliner(ID, -2000000000, InsertLifetime) {
+ initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry());
+ }
+
+ static char ID; // Pass identification, replacement for typeid
+
+ virtual InlineCost getInlineCost(CallSite CS);
+
+ using llvm::Pass::doFinalization;
+ virtual bool doFinalization(CallGraph &CG) {
+ return removeDeadFunctions(CG, /*AlwaysInlineOnly=*/ true);
+ }
+
+ using llvm::Pass::doInitialization;
+ virtual bool doInitialization(CallGraph &CG);
+};
+
}
char AlwaysInliner::ID = 0;
@@ -95,8 +100,6 @@ InlineCost AlwaysInliner::getInlineCost(CallSite CS) {
return InlineCost::getNever();
}
-// doInitialization - Initializes the vector of functions that have not
-// been annotated with the "always inline" attribute.
bool AlwaysInliner::doInitialization(CallGraph &CG) {
CA.setDataLayout(getAnalysisIfAvailable<DataLayout>());
return false;