start defining codes for instructions
[oota-llvm.git] / include / llvm / CodeGen / MachineRelocation.h
index 03dafc1112d3342266e0e87f3ff44814eabb825b..364b8b17e2a201e5e2e2c201f720f0421f53a1e8 100644 (file)
@@ -63,11 +63,18 @@ class MachineRelocation {
   } Target;
 
   unsigned TargetReloType : 6; // The target relocation ID.
-  AddressType AddrType    : 3; // The field of Target to use.
+  AddressType AddrType    : 4; // The field of Target to use.
   bool DoesntNeedFnStub   : 1; // True if we don't need a fn stub.
   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 {