mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Rename ConstPoolPointerReference to ConstPoolPointerRef - My fingers get tired typing that much
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@822 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -304,20 +304,20 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ConstPoolPointerReference - a constant pointer value that is initialized to
|
// ConstPoolPointerRef - a constant pointer value that is initialized to
|
||||||
// point to a global value, which lies at a constant, fixed address.
|
// point to a global value, which lies at a constant, fixed address.
|
||||||
//
|
//
|
||||||
class ConstPoolPointerReference : public ConstPoolPointer {
|
class ConstPoolPointerRef : public ConstPoolPointer {
|
||||||
friend class Module; // Modules maintain these references
|
friend class Module; // Modules maintain these references
|
||||||
ConstPoolPointerReference(const ConstPoolPointerReference &); // DNI!
|
ConstPoolPointerRef(const ConstPoolPointerRef &); // DNI!
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ConstPoolPointerReference(GlobalValue *GV);
|
ConstPoolPointerRef(GlobalValue *GV);
|
||||||
~ConstPoolPointerReference() {}
|
~ConstPoolPointerRef() {}
|
||||||
|
|
||||||
virtual void destroyConstant() { destroyConstantImpl(); }
|
virtual void destroyConstant() { destroyConstantImpl(); }
|
||||||
public:
|
public:
|
||||||
static ConstPoolPointerReference *get(GlobalValue *GV);
|
static ConstPoolPointerRef *get(GlobalValue *GV);
|
||||||
|
|
||||||
virtual string getStrValue() const;
|
virtual string getStrValue() const;
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
static inline bool classof(const ConstPoolPointerReference *) { return true; }
|
static inline bool classof(const ConstPoolPointerRef *) { return true; }
|
||||||
static inline bool classof(const ConstPoolPointer *CPV) {
|
static inline bool classof(const ConstPoolPointer *CPV) {
|
||||||
return CPV->getNumOperands() == 1;
|
return CPV->getNumOperands() == 1;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
class Method;
|
class Method;
|
||||||
class GlobalVariable;
|
class GlobalVariable;
|
||||||
class GlobalValueRefMap; // Used by ConstPoolVals.cpp
|
class GlobalValueRefMap; // Used by ConstPoolVals.cpp
|
||||||
class ConstPoolPointerReference;
|
class ConstPoolPointerRef;
|
||||||
|
|
||||||
class Module : public Value, public SymTabValue {
|
class Module : public Value, public SymTabValue {
|
||||||
public:
|
public:
|
||||||
@ -44,10 +44,10 @@ private:
|
|||||||
GlobalValueRefMap *GVRefMap;
|
GlobalValueRefMap *GVRefMap;
|
||||||
|
|
||||||
// Accessor for the underlying GlobalValRefMap... only through the
|
// Accessor for the underlying GlobalValRefMap... only through the
|
||||||
// ConstPoolPointerReference class...
|
// ConstPoolPointerRef class...
|
||||||
friend class ConstPoolPointerReference;
|
friend class ConstPoolPointerRef;
|
||||||
void mutateConstPoolPointerReference(GlobalValue *OldGV, GlobalValue *NewGV);
|
void mutateConstPoolPointerRef(GlobalValue *OldGV, GlobalValue *NewGV);
|
||||||
ConstPoolPointerReference *getConstPoolPointerReference(GlobalValue *GV);
|
ConstPoolPointerRef *getConstPoolPointerRef(GlobalValue *GV);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Module();
|
Module();
|
||||||
|
@ -61,7 +61,7 @@ static struct PerModuleInfo {
|
|||||||
// GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
|
// GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
|
||||||
// references to global values. Global values may be referenced before they
|
// references to global values. Global values may be referenced before they
|
||||||
// are defined, and if so, the temporary object that they represent is held
|
// are defined, and if so, the temporary object that they represent is held
|
||||||
// here. This is used for forward references of ConstPoolPointerReferences.
|
// here. This is used for forward references of ConstPoolPointerRefs.
|
||||||
//
|
//
|
||||||
typedef map<pair<const PointerType *, ValID>, GlobalVariable*> GlobalRefsType;
|
typedef map<pair<const PointerType *, ValID>, GlobalVariable*> GlobalRefsType;
|
||||||
GlobalRefsType GlobalRefs;
|
GlobalRefsType GlobalRefs;
|
||||||
@ -102,11 +102,11 @@ static struct PerModuleInfo {
|
|||||||
I->first.second.destroy(); // Free string memory if neccesary
|
I->first.second.destroy(); // Free string memory if neccesary
|
||||||
|
|
||||||
// Loop over all of the uses of the GlobalValue. The only thing they are
|
// Loop over all of the uses of the GlobalValue. The only thing they are
|
||||||
// allowed to be at this point is ConstPoolPointerReference's.
|
// allowed to be at this point is ConstPoolPointerRef's.
|
||||||
assert(OldGV->use_size() == 1 && "Only one reference should exist!");
|
assert(OldGV->use_size() == 1 && "Only one reference should exist!");
|
||||||
while (!OldGV->use_empty()) {
|
while (!OldGV->use_empty()) {
|
||||||
User *U = OldGV->use_back(); // Must be a ConstPoolPointerReference...
|
User *U = OldGV->use_back(); // Must be a ConstPoolPointerRef...
|
||||||
ConstPoolPointerReference *CPPR = cast<ConstPoolPointerReference>(U);
|
ConstPoolPointerRef *CPPR = cast<ConstPoolPointerRef>(U);
|
||||||
assert(CPPR->getValue() == OldGV && "Something isn't happy");
|
assert(CPPR->getValue() == OldGV && "Something isn't happy");
|
||||||
|
|
||||||
// Change the const pool reference to point to the real global variable
|
// Change the const pool reference to point to the real global variable
|
||||||
@ -987,7 +987,7 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
|
|||||||
}
|
}
|
||||||
|
|
||||||
GlobalValue *GV = cast<GlobalValue>(V);
|
GlobalValue *GV = cast<GlobalValue>(V);
|
||||||
$$ = ConstPoolPointerReference::get(GV);
|
$$ = ConstPoolPointerRef::get(GV);
|
||||||
delete $1; // Free the type handle
|
delete $1; // Free the type handle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ bool BytecodeParser::parseConstPoolValue(const uchar *&Buf,
|
|||||||
V = ConstPoolPointerNull::get(PT);
|
V = ConstPoolPointerNull::get(PT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: { // ConstPoolPointerReference value...
|
case 1: { // ConstPoolPointerRef value...
|
||||||
unsigned Slot;
|
unsigned Slot;
|
||||||
if (read_vbr(Buf, EndBuf, Slot)) return failure(true);
|
if (read_vbr(Buf, EndBuf, Slot)) return failure(true);
|
||||||
BCR_TRACE(4, "CPPR: Type: '" << Ty << "' slot: " << Slot << "\n");
|
BCR_TRACE(4, "CPPR: Type: '" << Ty << "' slot: " << Slot << "\n");
|
||||||
@ -308,7 +308,7 @@ bool BytecodeParser::parseConstPoolValue(const uchar *&Buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
V = ConstPoolPointerReference::get(GV);
|
V = ConstPoolPointerRef::get(GV);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -217,7 +217,7 @@ bool BytecodeParser::ParseSymbolTable(const uchar *&Buf, const uchar *EndBuf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DeclareNewGlobalValue - Patch up forward references to global values in the
|
// DeclareNewGlobalValue - Patch up forward references to global values in the
|
||||||
// form of ConstPoolPointerReferences.
|
// form of ConstPoolPointerRef.
|
||||||
//
|
//
|
||||||
void BytecodeParser::DeclareNewGlobalValue(GlobalValue *GV, unsigned Slot) {
|
void BytecodeParser::DeclareNewGlobalValue(GlobalValue *GV, unsigned Slot) {
|
||||||
// Check to see if there is a forward reference to this global variable...
|
// Check to see if there is a forward reference to this global variable...
|
||||||
@ -229,11 +229,11 @@ void BytecodeParser::DeclareNewGlobalValue(GlobalValue *GV, unsigned Slot) {
|
|||||||
BCR_TRACE(3, "Mutating CPPR Forward Ref!\n");
|
BCR_TRACE(3, "Mutating CPPR Forward Ref!\n");
|
||||||
|
|
||||||
// Loop over all of the uses of the GlobalValue. The only thing they are
|
// Loop over all of the uses of the GlobalValue. The only thing they are
|
||||||
// allowed to be at this point is ConstPoolPointerReference's.
|
// allowed to be at this point is ConstPoolPointerRef's.
|
||||||
assert(OldGV->use_size() == 1 && "Only one reference should exist!");
|
assert(OldGV->use_size() == 1 && "Only one reference should exist!");
|
||||||
while (!OldGV->use_empty()) {
|
while (!OldGV->use_empty()) {
|
||||||
User *U = OldGV->use_back(); // Must be a ConstPoolPointerReference...
|
User *U = OldGV->use_back(); // Must be a ConstPoolPointerRef...
|
||||||
ConstPoolPointerReference *CPPR = cast<ConstPoolPointerReference>(U);
|
ConstPoolPointerRef *CPPR = cast<ConstPoolPointerRef>(U);
|
||||||
assert(CPPR->getValue() == OldGV && "Something isn't happy");
|
assert(CPPR->getValue() == OldGV && "Something isn't happy");
|
||||||
|
|
||||||
BCR_TRACE(4, "Mutating Forward Ref!\n");
|
BCR_TRACE(4, "Mutating Forward Ref!\n");
|
||||||
|
@ -112,7 +112,7 @@ private:
|
|||||||
bool getTypeSlot(const Type *Ty, unsigned &Slot);
|
bool getTypeSlot(const Type *Ty, unsigned &Slot);
|
||||||
|
|
||||||
// DeclareNewGlobalValue - Patch up forward references to global values in the
|
// DeclareNewGlobalValue - Patch up forward references to global values in the
|
||||||
// form of ConstPoolPointerReferences.
|
// form of ConstPoolPointerRefs.
|
||||||
//
|
//
|
||||||
void DeclareNewGlobalValue(GlobalValue *GV, unsigned Slot);
|
void DeclareNewGlobalValue(GlobalValue *GV, unsigned Slot);
|
||||||
|
|
||||||
|
@ -145,8 +145,8 @@ bool BytecodeWriter::outputConstant(const ConstPoolVal *CPV) {
|
|||||||
const ConstPoolPointer *CPP = cast<const ConstPoolPointer>(CPV);
|
const ConstPoolPointer *CPP = cast<const ConstPoolPointer>(CPV);
|
||||||
if (isa<ConstPoolPointerNull>(CPP)) {
|
if (isa<ConstPoolPointerNull>(CPP)) {
|
||||||
output_vbr((unsigned)0, Out);
|
output_vbr((unsigned)0, Out);
|
||||||
} else if (const ConstPoolPointerReference *CPR =
|
} else if (const ConstPoolPointerRef *CPR =
|
||||||
dyn_cast<ConstPoolPointerReference>(CPP)) {
|
dyn_cast<ConstPoolPointerRef>(CPP)) {
|
||||||
output_vbr((unsigned)1, Out);
|
output_vbr((unsigned)1, Out);
|
||||||
int Slot = Table.getValSlot((Value*)CPR->getValue());
|
int Slot = Table.getValSlot((Value*)CPR->getValue());
|
||||||
assert(Slot != -1 && "Global used but not available!!");
|
assert(Slot != -1 && "Global used but not available!!");
|
||||||
|
@ -64,10 +64,9 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
|
|||||||
Result = ConstPoolStruct::get(cast<StructType>(CPS->getType()), Operands);
|
Result = ConstPoolStruct::get(cast<StructType>(CPS->getType()), Operands);
|
||||||
} else if (isa<ConstPoolPointerNull>(CPV)) {
|
} else if (isa<ConstPoolPointerNull>(CPV)) {
|
||||||
Result = CPV;
|
Result = CPV;
|
||||||
} else if (ConstPoolPointerReference *CPR =
|
} else if (ConstPoolPointerRef *CPR = dyn_cast<ConstPoolPointerRef>(CPV)) {
|
||||||
dyn_cast<ConstPoolPointerReference>(CPV)) {
|
|
||||||
Value *V = RemapOperand(CPR->getValue(), LocalMap, GlobalMap);
|
Value *V = RemapOperand(CPR->getValue(), LocalMap, GlobalMap);
|
||||||
Result = ConstPoolPointerReference::get(cast<GlobalValue>(V));
|
Result = ConstPoolPointerRef::get(cast<GlobalValue>(V));
|
||||||
} else {
|
} else {
|
||||||
assert(0 && "Unknown type of derived type constant value!");
|
assert(0 && "Unknown type of derived type constant value!");
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,10 @@ const char* const PRINTF = "printf";
|
|||||||
|
|
||||||
#undef USE_PTRREF
|
#undef USE_PTRREF
|
||||||
#ifdef USE_PTRREF
|
#ifdef USE_PTRREF
|
||||||
static inline ConstPoolPointerReference*
|
static inline ConstPoolPointerRef*
|
||||||
GetStringRef(Module* module, const char* str)
|
GetStringRef(Module* module, const char* str)
|
||||||
{
|
{
|
||||||
static hash_map<string, ConstPoolPointerReference*> stringRefCache;
|
static hash_map<string, ConstPoolPointerRef*> stringRefCache;
|
||||||
static Module* lastModule = NULL;
|
static Module* lastModule = NULL;
|
||||||
|
|
||||||
if (lastModule != module)
|
if (lastModule != module)
|
||||||
@ -53,14 +53,14 @@ GetStringRef(Module* module, const char* str)
|
|||||||
lastModule = module;
|
lastModule = module;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstPoolPointerReference* result = stringRefCache[str];
|
ConstPoolPointerRef* result = stringRefCache[str];
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
{
|
{
|
||||||
ConstPoolArray* charArray = ConstPoolArray::get(str);
|
ConstPoolArray* charArray = ConstPoolArray::get(str);
|
||||||
GlobalVariable* stringVar =
|
GlobalVariable* stringVar =
|
||||||
new GlobalVariable(charArray->getType(),/*isConst*/true,charArray,str);
|
new GlobalVariable(charArray->getType(),/*isConst*/true,charArray,str);
|
||||||
module->getGlobalList().push_back(stringVar);
|
module->getGlobalList().push_back(stringVar);
|
||||||
result = ConstPoolPointerReference::get(stringVar);
|
result = ConstPoolPointerRef::get(stringVar);
|
||||||
assert(result && "Failed to create reference to string constant");
|
assert(result && "Failed to create reference to string constant");
|
||||||
stringRefCache[str] = result;
|
stringRefCache[str] = result;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ GetStringRef(Module* module, const char* str)
|
|||||||
new GlobalVariable(charArray->getType(),/*isConst*/true,charArray);
|
new GlobalVariable(charArray->getType(),/*isConst*/true,charArray);
|
||||||
module->getGlobalList().push_back(stringVar);
|
module->getGlobalList().push_back(stringVar);
|
||||||
result = stringVar;
|
result = stringVar;
|
||||||
// result = ConstPoolPointerReference::get(stringVar);
|
// result = ConstPoolPointerRef::get(stringVar);
|
||||||
assert(result && "Failed to create reference to string constant");
|
assert(result && "Failed to create reference to string constant");
|
||||||
stringRefCache[str] = result;
|
stringRefCache[str] = result;
|
||||||
}
|
}
|
||||||
|
@ -64,10 +64,9 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
|
|||||||
Result = ConstPoolStruct::get(cast<StructType>(CPS->getType()), Operands);
|
Result = ConstPoolStruct::get(cast<StructType>(CPS->getType()), Operands);
|
||||||
} else if (isa<ConstPoolPointerNull>(CPV)) {
|
} else if (isa<ConstPoolPointerNull>(CPV)) {
|
||||||
Result = CPV;
|
Result = CPV;
|
||||||
} else if (ConstPoolPointerReference *CPR =
|
} else if (ConstPoolPointerRef *CPR = dyn_cast<ConstPoolPointerRef>(CPV)) {
|
||||||
dyn_cast<ConstPoolPointerReference>(CPV)) {
|
|
||||||
Value *V = RemapOperand(CPR->getValue(), LocalMap, GlobalMap);
|
Value *V = RemapOperand(CPR->getValue(), LocalMap, GlobalMap);
|
||||||
Result = ConstPoolPointerReference::get(cast<GlobalValue>(V));
|
Result = ConstPoolPointerRef::get(cast<GlobalValue>(V));
|
||||||
} else {
|
} else {
|
||||||
assert(0 && "Unknown type of derived type constant value!");
|
assert(0 && "Unknown type of derived type constant value!");
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ ConstPoolStruct::ConstPoolStruct(const StructType *T,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstPoolPointerReference::ConstPoolPointerReference(GlobalValue *GV)
|
ConstPoolPointerRef::ConstPoolPointerRef(GlobalValue *GV)
|
||||||
: ConstPoolPointer(GV->getType()) {
|
: ConstPoolPointer(GV->getType()) {
|
||||||
Operands.push_back(Use(GV, this));
|
Operands.push_back(Use(GV, this));
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ string ConstPoolPointerNull::getStrValue() const {
|
|||||||
return "null";
|
return "null";
|
||||||
}
|
}
|
||||||
|
|
||||||
string ConstPoolPointerReference::getStrValue() const {
|
string ConstPoolPointerRef::getStrValue() const {
|
||||||
const GlobalValue *V = getValue();
|
const GlobalValue *V = getValue();
|
||||||
if (V->hasName()) return "%" + V->getName();
|
if (V->hasName()) return "%" + V->getName();
|
||||||
|
|
||||||
@ -482,17 +482,17 @@ ConstPoolPointerNull *ConstPoolPointerNull::get(const PointerType *Ty) {
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---- ConstPoolPointerReference::get() implementation...
|
//---- ConstPoolPointerRef::get() implementation...
|
||||||
//
|
//
|
||||||
ConstPoolPointerReference *ConstPoolPointerReference::get(GlobalValue *GV) {
|
ConstPoolPointerRef *ConstPoolPointerRef::get(GlobalValue *GV) {
|
||||||
assert(GV->getParent() && "Global Value must be attached to a module!");
|
assert(GV->getParent() && "Global Value must be attached to a module!");
|
||||||
|
|
||||||
// The Module handles the pointer reference sharing...
|
// The Module handles the pointer reference sharing...
|
||||||
return GV->getParent()->getConstPoolPointerReference(GV);
|
return GV->getParent()->getConstPoolPointerRef(GV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ConstPoolPointerReference::mutateReference(GlobalValue *NewGV) {
|
void ConstPoolPointerRef::mutateReference(GlobalValue *NewGV) {
|
||||||
getValue()->getParent()->mutateConstPoolPointerReference(getValue(), NewGV);
|
getValue()->getParent()->mutateConstPoolPointerRef(getValue(), NewGV);
|
||||||
Operands[0] = NewGV;
|
Operands[0] = NewGV;
|
||||||
}
|
}
|
||||||
|
@ -64,10 +64,9 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
|
|||||||
Result = ConstPoolStruct::get(cast<StructType>(CPS->getType()), Operands);
|
Result = ConstPoolStruct::get(cast<StructType>(CPS->getType()), Operands);
|
||||||
} else if (isa<ConstPoolPointerNull>(CPV)) {
|
} else if (isa<ConstPoolPointerNull>(CPV)) {
|
||||||
Result = CPV;
|
Result = CPV;
|
||||||
} else if (ConstPoolPointerReference *CPR =
|
} else if (ConstPoolPointerRef *CPR = dyn_cast<ConstPoolPointerRef>(CPV)) {
|
||||||
dyn_cast<ConstPoolPointerReference>(CPV)) {
|
|
||||||
Value *V = RemapOperand(CPR->getValue(), LocalMap, GlobalMap);
|
Value *V = RemapOperand(CPR->getValue(), LocalMap, GlobalMap);
|
||||||
Result = ConstPoolPointerReference::get(cast<GlobalValue>(V));
|
Result = ConstPoolPointerRef::get(cast<GlobalValue>(V));
|
||||||
} else {
|
} else {
|
||||||
assert(0 && "Unknown type of derived type constant value!");
|
assert(0 && "Unknown type of derived type constant value!");
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ template class ValueHolder<Method, Module, Module>;
|
|||||||
// Define the GlobalValueRefMap as a struct that wraps a map so that we don't
|
// Define the GlobalValueRefMap as a struct that wraps a map so that we don't
|
||||||
// have Module.h depend on <map>
|
// have Module.h depend on <map>
|
||||||
//
|
//
|
||||||
struct GlobalValueRefMap : public map<GlobalValue*, ConstPoolPointerReference*>{
|
struct GlobalValueRefMap : public map<GlobalValue*, ConstPoolPointerRef*>{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ void Module::dropAllReferences() {
|
|||||||
if (GVRefMap) {
|
if (GVRefMap) {
|
||||||
for (GlobalValueRefMap::iterator I = GVRefMap->begin(), E = GVRefMap->end();
|
for (GlobalValueRefMap::iterator I = GVRefMap->begin(), E = GVRefMap->end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Delete the ConstPoolPointerReference node...
|
// Delete the ConstPoolPointerRef node...
|
||||||
I->second->destroyConstant();
|
I->second->destroyConstant();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,25 +88,24 @@ bool Module::reduceApply(bool (*Func)(const Method*)) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Accessor for the underlying GlobalValRefMap...
|
// Accessor for the underlying GlobalValRefMap...
|
||||||
ConstPoolPointerReference *Module::getConstPoolPointerReference(GlobalValue *V){
|
ConstPoolPointerRef *Module::getConstPoolPointerRef(GlobalValue *V){
|
||||||
// Create ref map lazily on demand...
|
// Create ref map lazily on demand...
|
||||||
if (GVRefMap == 0) GVRefMap = new GlobalValueRefMap();
|
if (GVRefMap == 0) GVRefMap = new GlobalValueRefMap();
|
||||||
|
|
||||||
GlobalValueRefMap::iterator I = GVRefMap->find(V);
|
GlobalValueRefMap::iterator I = GVRefMap->find(V);
|
||||||
if (I != GVRefMap->end()) return I->second;
|
if (I != GVRefMap->end()) return I->second;
|
||||||
|
|
||||||
ConstPoolPointerReference *Ref = new ConstPoolPointerReference(V);
|
ConstPoolPointerRef *Ref = new ConstPoolPointerRef(V);
|
||||||
GVRefMap->insert(make_pair(V, Ref));
|
GVRefMap->insert(make_pair(V, Ref));
|
||||||
|
|
||||||
return Ref;
|
return Ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::mutateConstPoolPointerReference(GlobalValue *OldGV,
|
void Module::mutateConstPoolPointerRef(GlobalValue *OldGV, GlobalValue *NewGV) {
|
||||||
GlobalValue *NewGV) {
|
|
||||||
GlobalValueRefMap::iterator I = GVRefMap->find(OldGV);
|
GlobalValueRefMap::iterator I = GVRefMap->find(OldGV);
|
||||||
assert(I != GVRefMap->end() &&
|
assert(I != GVRefMap->end() &&
|
||||||
"mutateConstPoolPointerReference; OldGV not in table!");
|
"mutateConstPoolPointerRef; OldGV not in table!");
|
||||||
ConstPoolPointerReference *Ref = I->second;
|
ConstPoolPointerRef *Ref = I->second;
|
||||||
|
|
||||||
// Remove the old entry...
|
// Remove the old entry...
|
||||||
GVRefMap->erase(I);
|
GVRefMap->erase(I);
|
||||||
|
Reference in New Issue
Block a user