mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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
This commit is contained in:
parent
36c2451ddb
commit
5381baa051
@ -68,6 +68,13 @@ class MachineRelocation {
|
|||||||
bool GOTRelative : 1; // Should this relocation be relative to the GOT?
|
bool GOTRelative : 1; // Should this relocation be relative to the GOT?
|
||||||
|
|
||||||
public:
|
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.
|
/// MachineRelocation::getGV - Return a relocation entry for a GlobalValue.
|
||||||
///
|
///
|
||||||
static MachineRelocation getGV(intptr_t offset, unsigned RelocationType,
|
static MachineRelocation getGV(intptr_t offset, unsigned RelocationType,
|
||||||
@ -173,6 +180,13 @@ public:
|
|||||||
return ConstantVal;
|
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
|
/// isGlobalValue - Return true if this relocation is a GlobalValue, as
|
||||||
/// opposed to a constant string.
|
/// opposed to a constant string.
|
||||||
bool isGlobalValue() const {
|
bool isGlobalValue() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user