Assorted comment/naming fixes, 80-col violations, and reindentation.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 28 Oct 2008 23:24:26 +0000 (23:24 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 28 Oct 2008 23:24:26 +0000 (23:24 +0000)
 - No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58352 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Utils/InlineCost.h
lib/Transforms/IPO/InlineAlways.cpp
lib/Transforms/Utils/BasicInliner.cpp

index 66ea26b5c0494640fac78a75bf37d2773faf348a..154ba1a4d4546fa786ae7181a3443357520e4c4f 100644 (file)
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef INLINECOST_H
-#define INLINECOST_H
+#ifndef LLVM_TRANSFORMS_UTILS_INLINECOST_H
+#define LLVM_TRANSFORMS_UTILS_INLINECOST_H
 
 #include "llvm/ADT/SmallPtrSet.h"
 #include <map>
@@ -46,7 +46,7 @@ namespace llvm {
       /// is used to estimate the code size cost of inlining it.
       unsigned NumInsts, NumBlocks;
 
-      /// NumVectorInsts - Keep track how many instrctions produce vector
+      /// NumVectorInsts - Keep track of how many instructions produce vector
       /// values.  The inliner is being more aggressive with inlining vector
       /// kernels.
       unsigned NumVectorInsts;
index 1079c4ad738bc8f44b22f5baf646f2784ed2f4f0..2799d6b22bc595a7de72c48eb1bf0b8473a1c2bd 100644 (file)
@@ -51,14 +51,13 @@ namespace {
 
 char AlwaysInliner::ID = 0;
 static RegisterPass<AlwaysInliner>
-X("always-inline", "Inliner that handles always_inline functions");
+X("always-inline", "Inliner for always_inline functions");
 
 Pass *llvm::createAlwaysInlinerPass() { return new AlwaysInliner(); }
 
 // doInitialization - Initializes the vector of functions that have not 
 // been annotated with the "always inline" attribute.
 bool AlwaysInliner::doInitialization(CallGraph &CG) {
-  
   Module &M = CG.getModule();
   
   for (Module::iterator I = M.begin(), E = M.end();
@@ -68,4 +67,3 @@ bool AlwaysInliner::doInitialization(CallGraph &CG) {
 
   return false;
 }
-
index 5c2c6989b71611d5dfe267ca68d52fa4d0a3562b..ba1fb3d9c4ea00ce6ef5263e34bfc33f97d1ae90 100644 (file)
@@ -28,7 +28,7 @@ using namespace llvm;
 
 static cl::opt<unsigned>     
 BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200),
-                     cl::desc("Control the amount of basic inlining to perform (default = 200)"));
+   cl::desc("Control the amount of basic inlining to perform (default = 200)"));
 
 namespace llvm {
 
@@ -95,22 +95,23 @@ void BasicInlinerImpl::inlineFunctions() {
   bool Changed = false;
   do {
     Changed = false;
-    for (unsigned index = 0; index != CallSites.size() && !CallSites.empty(); ++index) {
+    for (unsigned index = 0; index != CallSites.size() && !CallSites.empty(); 
+         ++index) {
       CallSite CS = CallSites[index];
       if (Function *Callee = CS.getCalledFunction()) {
         
-        // Eliminate calls taht are never inlinable.
+        // Eliminate calls that are never inlinable.
         if (Callee->isDeclaration() ||
             CS.getInstruction()->getParent()->getParent() == Callee) {
           CallSites.erase(CallSites.begin() + index);
-              --index;
-              continue;
+          --index;
+          continue;
         }
         int InlineCost = CA.getInlineCost(CS, NeverInline);
         if (InlineCost >= (int) BasicInlineThreshold) {
-              DOUT << "  NOT Inlining: cost = " << InlineCost
-                   << ", call: " <<  *CS.getInstruction();
-              continue;
+          DOUT << "  NOT Inlining: cost = " << InlineCost
+               << ", call: " <<  *CS.getInstruction();
+          continue;
         }
         
         DOUT << "  Inlining: cost=" << InlineCost
@@ -119,7 +120,7 @@ void BasicInlinerImpl::inlineFunctions() {
         // Inline
         if (InlineFunction(CS, NULL, TD)) {
           if (Callee->use_empty() && Callee->hasInternalLinkage())
-                DeadFunctions.insert(Callee);
+            DeadFunctions.insert(Callee);
           Changed = true;
           CallSites.erase(CallSites.begin() + index);
           --index;