diff options
author | Nate Begeman <natebegeman@mac.com> | 2006-12-11 02:19:29 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2006-12-11 02:19:29 +0000 |
commit | 5381baa051562f0ec14ffa97072c0a9adfe87bf0 (patch) | |
tree | 34c8110489150824ff464b4213bd41ee3ef75340 /include/llvm/CodeGen/MachineRelocation.h | |
parent | 36c2451ddbe80dc9644b91fe1d31e7fb82b11e13 (diff) |
Add a default relocation type, and allow clients to set the ConstantVal
field after creation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineRelocation.h')
-rw-r--r-- | include/llvm/CodeGen/MachineRelocation.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineRelocation.h b/include/llvm/CodeGen/MachineRelocation.h index 03dafc1112..65a1f10fe3 100644 --- a/include/llvm/CodeGen/MachineRelocation.h +++ b/include/llvm/CodeGen/MachineRelocation.h @@ -68,6 +68,13 @@ class MachineRelocation { bool GOTRelative : 1; // Should this relocation be relative to the GOT? public: + // Relocation types used in a generic implementation. Currently, relocation + // entries for all things use the generic VANILLA type until they are refined + // into target relocation types. + enum RelocationType { + VANILLA + }; + /// MachineRelocation::getGV - Return a relocation entry for a GlobalValue. /// static MachineRelocation getGV(intptr_t offset, unsigned RelocationType, @@ -173,6 +180,13 @@ public: return ConstantVal; } + /// setConstantVal - Set the constant value associated with this relocation. + /// This is often an offset from the symbol. + /// + void setConstantVal(intptr_t val) { + ConstantVal = val; + } + /// isGlobalValue - Return true if this relocation is a GlobalValue, as /// opposed to a constant string. bool isGlobalValue() const { |