summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineRelocation.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-10-29 23:53:42 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-10-29 23:53:42 +0000
commit70ba70f0659c331f02675139d3ae42d021e3d5b3 (patch)
tree9fc6aab7d0dc4e45aec74737fb3e0ce9bd4416cc /include/llvm/CodeGen/MachineRelocation.h
parent110e3b3d1b4cedf8d0751c11dab3cc715421afa5 (diff)
downloadllvm-70ba70f0659c331f02675139d3ae42d021e3d5b3.tar.gz
llvm-70ba70f0659c331f02675139d3ae42d021e3d5b3.tar.bz2
llvm-70ba70f0659c331f02675139d3ae42d021e3d5b3.tar.xz
Add a bit to MachineRelocation that tells JIT that target is responsible for resolving the address. e.g. ARM constpool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58405 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineRelocation.h')
-rw-r--r--include/llvm/CodeGen/MachineRelocation.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/MachineRelocation.h b/include/llvm/CodeGen/MachineRelocation.h
index fa23a4d1c4..5c8302a56f 100644
--- a/include/llvm/CodeGen/MachineRelocation.h
+++ b/include/llvm/CodeGen/MachineRelocation.h
@@ -63,10 +63,11 @@ class MachineRelocation {
unsigned GOTIndex; // Index in the GOT of this symbol/global
} Target;
- unsigned TargetReloType : 6; // The target relocation ID.
- AddressType AddrType : 4; // The field of Target to use.
- bool NeedStub : 1; // True if this relocation requires a stub.
+ unsigned TargetReloType : 6; // The target relocation ID
+ AddressType AddrType : 4; // The field of Target to use
+ bool NeedStub : 1; // True if this relocation requires a stub
bool GOTRelative : 1; // Should this relocation be relative to the GOT?
+ bool TargetResolve : 1; // True if target should resolve the address
public:
// Relocation types used in a generic implementation. Currently, relocation
@@ -90,6 +91,7 @@ public:
Result.AddrType = isGV;
Result.NeedStub = NeedStub;
Result.GOTRelative = GOTrelative;
+ Result.TargetResolve = false;
Result.Target.GV = GV;
return Result;
}
@@ -109,6 +111,7 @@ public:
Result.AddrType = isGVLazyPtr;
Result.NeedStub = NeedStub;
Result.GOTRelative = GOTrelative;
+ Result.TargetResolve = false;
Result.Target.GV = GV;
return Result;
}
@@ -125,6 +128,7 @@ public:
Result.AddrType = isBB;
Result.NeedStub = false;
Result.GOTRelative = false;
+ Result.TargetResolve = false;
Result.Target.MBB = MBB;
return Result;
}
@@ -143,6 +147,7 @@ public:
Result.AddrType = isExtSym;
Result.NeedStub = true;
Result.GOTRelative = GOTrelative;
+ Result.TargetResolve = false;
Result.Target.ExtSym = ES;
return Result;
}
@@ -151,7 +156,8 @@ public:
/// pool entry.
///
static MachineRelocation getConstPool(intptr_t offset,unsigned RelocationType,
- unsigned CPI, intptr_t cst = 0) {
+ unsigned CPI, intptr_t cst = 0,
+ bool letTargetResolve = false) {
assert((RelocationType & ~63) == 0 && "Relocation type too large!");
MachineRelocation Result;
Result.Offset = offset;
@@ -160,6 +166,7 @@ public:
Result.AddrType = isConstPool;
Result.NeedStub = false;
Result.GOTRelative = false;
+ Result.TargetResolve = letTargetResolve;
Result.Target.Index = CPI;
return Result;
}
@@ -177,6 +184,7 @@ public:
Result.AddrType = isJumpTable;
Result.NeedStub = false;
Result.GOTRelative = false;
+ Result.TargetResolve = false;
Result.Target.Index = JTI;
return Result;
}
@@ -257,6 +265,12 @@ public:
return !NeedStub;
}
+ /// letTargetResolve - Return true if the target JITInfo is usually
+ /// responsible for resolving the address of this relocation.
+ bool letTargetResolve() const {
+ return TargetResolve;
+ }
+
/// getGlobalValue - If this is a global value reference, return the
/// referenced global.
GlobalValue *getGlobalValue() const {