#ifndef PIC16CLONER_H
#define PIC16CLONER_H
-#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/ValueMap.h"
using namespace llvm;
using std::vector;
class PIC16Cloner : public ModulePass {
public:
static char ID; // Class identification
- PIC16Cloner() : ModulePass(&ID) {}
+ PIC16Cloner() : ModulePass(ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<CallGraph>();
// Clone all shared functions.
void cloneSharedFunctions(CallGraphNode *isrCGN);
+ // Remap all call sites to the shared function.
+ void remapAllSites(Function *Caller, Function *OrgF, Function *Clone);
+
// Error reporting for PIC16Pass
void reportError(string ErrorString, vector<string> &Values);
void reportError(string ErrorString);
// the corresponding cloned auto variable of the cloned function.
// This value map is passed during the function cloning so that all the
// uses of auto variables be updated properly.
- DenseMap<const Value*, Value*> ValueMap;
+ ValueMap<const Value*, Value*> VMap;
// Map of a already cloned functions.
map<Function *, Function *> ClonedFunctionMap;