[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineRelocation.h

Nate Begeman natebegeman at mac.com
Sun Dec 10 18:19:44 PST 2006



Changes in directory llvm/include/llvm/CodeGen:

MachineRelocation.h updated: 1.11 -> 1.12
---
Log message:

Add a default relocation type, and allow clients to set the ConstantVal
field after creation.


---
Diffs of the changes:  (+14 -0)

 MachineRelocation.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+)


Index: llvm/include/llvm/CodeGen/MachineRelocation.h
diff -u llvm/include/llvm/CodeGen/MachineRelocation.h:1.11 llvm/include/llvm/CodeGen/MachineRelocation.h:1.12
--- llvm/include/llvm/CodeGen/MachineRelocation.h:1.11	Thu Jul 27 13:18:13 2006
+++ llvm/include/llvm/CodeGen/MachineRelocation.h	Sun Dec 10 20:19:29 2006
@@ -68,6 +68,13 @@
   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 @@
     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 {






More information about the llvm-commits mailing list