Use SmallPtrSet.
authorDevang Patel <dpatel@apple.com>
Fri, 27 Jul 2007 18:34:27 +0000 (18:34 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 27 Jul 2007 18:34:27 +0000 (18:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40560 91177308-0d34-0410-b5e6-96231b3b80d8

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

index c54b98af523b99a92920f06a7207a60a9f470678..509217b00c7b411a845a4d445865df1b1df73da4 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef INLINECOST_H
 #define INLINECOST_H
 
-#include <set>
+#include "llvm/ADT/SmallPtrSet.h"
 #include <map>
 #include <vector>
 
@@ -73,7 +73,7 @@ namespace llvm {
     // getInlineCost - The heuristic used to determine if we should inline the
     // function call or not.
     //
-    int getInlineCost(CallSite CS, std::set<const Function *> &NeverInline);
+    int getInlineCost(CallSite CS, SmallPtrSet<const Function *, 16> &NeverInline);
   };
 }
 
index eea28a745c57902a637e9fe7b92c20312da8222f..38bf0610b3872e84c2b5792cef96db1b77facc24 100644 (file)
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Transforms/IPO/InlinerPass.h"
 #include "llvm/Transforms/Utils/InlineCost.h"
-#include <set>
+#include "llvm/ADT/SmallPtrSet.h"
 
 using namespace llvm;
 
 namespace {
 
   class VISIBILITY_HIDDEN SimpleInliner : public Inliner {
-    std::set<const Function*> NeverInline; // Functions that are never inlined
+    // Functions that are never inlined
+    SmallPtrSet<const Function*, 16> NeverInline; 
     InlineCostAnalyzer CA;
   public:
     SimpleInliner() : Inliner(&ID) {}
index 871b1a504a38d29b1775d8c8940e9ab8b25d7f56..9325d5f2e0475c943911e3f38a14e2ae80ca80f5 100644 (file)
@@ -23,7 +23,6 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include <vector>
-#include <set>
 
 using namespace llvm;
 
@@ -65,7 +64,7 @@ namespace llvm {
   private:
     TargetData *TD;
     std::vector<Function *> Functions;
-    std::set<const Function *> NeverInline;
+    SmallPtrSet<const Function *, 16> NeverInline;
     SmallPtrSet<Function *, 8> DeadFunctions;
     InlineCostAnalyzer CA;
   };
index 8b34427ac67c6eaecffe6cf8962202c3c8c06939..c568355a5f356f9878e82d09c797c86ce5d45e98 100644 (file)
@@ -141,7 +141,7 @@ void InlineCostAnalyzer::FunctionInfo::analyzeFunction(Function *F) {
 // getInlineCost - The heuristic used to determine if we should inline the
 // function call or not.
 //
-int InlineCostAnalyzer::getInlineCost(CallSite CS, std::set<const Function *> &NeverInline) {
+int InlineCostAnalyzer::getInlineCost(CallSite CS, SmallPtrSet<const Function *, 16> &NeverInline) {
   Instruction *TheCall = CS.getInstruction();
   Function *Callee = CS.getCalledFunction();
   const Function *Caller = TheCall->getParent()->getParent();