summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMJITInfo.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-10-29 23:55:43 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-10-29 23:55:43 +0000
commit0f282439be688babbbf6d54151ddf9a7ebbf3637 (patch)
treea3fa9408bff75a18ff16c936d39a841c9e826531 /lib/Target/ARM/ARMJITInfo.h
parent5be59eace58e5a92bb851c4885f9cea7236ac30f (diff)
downloadllvm-0f282439be688babbbf6d54151ddf9a7ebbf3637.tar.gz
llvm-0f282439be688babbbf6d54151ddf9a7ebbf3637.tar.bz2
llvm-0f282439be688babbbf6d54151ddf9a7ebbf3637.tar.xz
Correct way to handle CONSTPOOL_ENTRY instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMJITInfo.h')
-rw-r--r--lib/Target/ARM/ARMJITInfo.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/lib/Target/ARM/ARMJITInfo.h b/lib/Target/ARM/ARMJITInfo.h
index 62b8303010..f16e54205a 100644
--- a/lib/Target/ARM/ARMJITInfo.h
+++ b/lib/Target/ARM/ARMJITInfo.h
@@ -22,7 +22,11 @@ namespace llvm {
class ARMJITInfo : public TargetJITInfo {
ARMTargetMachine &TM;
- std::map<unsigned, intptr_t> CPIDtoAddressMap;
+
+ // ConstPoolId2AddrMap - A map from constant pool ids to the corresponding
+ // CONSTPOOL_ENTRY addresses.
+ std::map<unsigned, intptr_t> ConstPoolId2AddrMap;
+
public:
explicit ARMJITInfo(ARMTargetMachine &tm) : TM(tm) { useGOT = false; }
@@ -52,22 +56,22 @@ namespace llvm {
/// pool address resolution is handled by the target.
virtual bool hasCustomConstantPool() const { return true; }
- /// getCustomConstantPoolEntryAddress - The ARM target puts all constant
+ /// getConstantPoolEntryAddr - The ARM target puts all constant
/// pool entries into constant islands. Resolve the constant pool index
/// into the address where the constant is stored.
- virtual intptr_t getCustomConstantPoolEntryAddress(unsigned CPID) const
- {
- std::map<unsigned, intptr_t>::const_iterator elem;
- elem = CPIDtoAddressMap.find(CPID);
- assert (elem != CPIDtoAddressMap.end());
- return elem->second;
- }
+ virtual intptr_t getConstantPoolEntryAddr(unsigned CPID) const {
+ std::map<unsigned, intptr_t>::const_iterator I
+ = ConstPoolId2AddrMap.find(CPID);
+ assert(I != ConstPoolId2AddrMap.end() && "Missing constpool_entry?");
+ return I->second;
+ }
- /// mapCPIDtoAddress - Map a Constant Pool Index (CPID) to the address
+ /// addConstantPoolEntryAddr - Map a Constant Pool Index (CPID) to the address
/// where its associated value is stored. When relocations are processed,
/// this value will be used to resolve references to the constant.
- void mapCPIDtoAddress(unsigned CPID, intptr_t address)
- { CPIDtoAddressMap[CPID] = address; }
+ void addConstantPoolEntryAddr(unsigned CPID, intptr_t Addr) {
+ ConstPoolId2AddrMap[CPID] = Addr;
+ }
};
}