#ifndef INLINECOST_H
#define INLINECOST_H
-#include <set>
+#include "llvm/ADT/SmallPtrSet.h"
#include <map>
#include <vector>
// 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);
};
}
#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) {}
#include "llvm/Support/Debug.h"
#include "llvm/ADT/SmallPtrSet.h"
#include <vector>
-#include <set>
using 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;
};
// 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();