mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
This is the proper code for this method, thanks to Reid for getting CVS working
again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18103 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8fb51e4800
commit
f5feaf4fe3
@ -93,11 +93,20 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// FIXME: I have no idea if this is right, I just implemented it to get
|
/// updateGlobalMapping - Replace an existing mapping for GV with a new
|
||||||
/// the build to compile because it is called by JIT/Emitter.cpp.
|
/// address. This updates both maps as required.
|
||||||
void updateGlobalMapping(const GlobalValue *GV, void*Addr) {
|
void updateGlobalMapping(const GlobalValue *GV, void *Addr) {
|
||||||
GlobalAddressMap[GV] = Addr;
|
void *&CurVal = GlobalAddressMap[GV];
|
||||||
GlobalAddressReverseMap[Addr] = GV;
|
if (CurVal && !GlobalAddressReverseMap.empty())
|
||||||
|
GlobalAddressReverseMap.erase(CurVal);
|
||||||
|
CurVal = Addr;
|
||||||
|
|
||||||
|
// If we are using the reverse mapping, add it too
|
||||||
|
if (!GlobalAddressReverseMap.empty()) {
|
||||||
|
const GlobalValue *&V = GlobalAddressReverseMap[Addr];
|
||||||
|
assert((V == 0 || GV == 0) && "GlobalMapping already established!");
|
||||||
|
V = GV;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getPointerToGlobalIfAvailable - This returns the address of the specified
|
/// getPointerToGlobalIfAvailable - This returns the address of the specified
|
||||||
|
Loading…
x
Reference in New Issue
Block a user