ARM64: initial backend import
[oota-llvm.git] / include / llvm / MC / MCExpr.h
index 6ac4f94e829b2c2c15b907739f637fbfa2dab9d2..0033a54e4220b7c1baee71d82911d4aaa177b28d 100644 (file)
@@ -15,6 +15,7 @@
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
+class MCAsmInfo;
 class MCAsmLayout;
 class MCAssembler;
 class MCContext;
@@ -90,7 +91,7 @@ public:
   /// @param Res - The relocatable value, if evaluation succeeds.
   /// @param Layout - The assembler layout object to use for evaluating values.
   /// @result - True on success.
-  bool EvaluateAsRelocatable(MCValue &Res, const MCAsmLayout &Layout) const;
+  bool EvaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout) const;
 
   /// FindAssociatedSection - Find the "associated section" for this expression,
   /// which is currently defined as the absolute section for constants, or
@@ -157,19 +158,24 @@ public:
     VK_TLSLDM,
     VK_TPOFF,
     VK_DTPOFF,
-    VK_TLVP,      // Mach-O thread local variable relocation
+    VK_TLVP,      // Mach-O thread local variable relocations
+    VK_TLVPPAGE,
+    VK_TLVPPAGEOFF,
+    VK_PAGE,
+    VK_PAGEOFF,
+    VK_GOTPAGE,
+    VK_GOTPAGEOFF,
     VK_SECREL,
-    // FIXME: We'd really like to use the generic Kinds listed above for these.
+    VK_WEAKREF,   // The link between the symbols in .weakref foo, bar
+
     VK_ARM_NONE,
-    VK_ARM_PLT,   // ARM-style PLT references. i.e., (PLT) instead of @PLT
-    VK_ARM_TLSGD, //   ditto for TLSGD, GOT, GOTOFF, TPOFF and GOTTPOFF
-    VK_ARM_GOT,
-    VK_ARM_GOTOFF,
-    VK_ARM_TPOFF,
-    VK_ARM_GOTTPOFF,
     VK_ARM_TARGET1,
     VK_ARM_TARGET2,
     VK_ARM_PREL31,
+    VK_ARM_TLSLDO,         // symbol(tlsldo)
+    VK_ARM_TLSCALL,        // symbol(tlscall)
+    VK_ARM_TLSDESC,        // symbol(tlsdesc)
+    VK_ARM_TLSDESCSEQ,
 
     VK_PPC_LO,             // symbol@l
     VK_PPC_HI,             // symbol@h
@@ -186,6 +192,7 @@ public:
     VK_PPC_TOC_LO,         // symbol@toc@l
     VK_PPC_TOC_HI,         // symbol@toc@h
     VK_PPC_TOC_HA,         // symbol@toc@ha
+    VK_PPC_DTPMOD,         // symbol@dtpmod
     VK_PPC_TPREL,          // symbol@tprel
     VK_PPC_TPREL_LO,       // symbol@tprel@l
     VK_PPC_TPREL_HI,       // symbol@tprel@h
@@ -257,9 +264,14 @@ private:
   /// The symbol reference modifier.
   const VariantKind Kind;
 
-  explicit MCSymbolRefExpr(const MCSymbol *_Symbol, VariantKind _Kind)
-    : MCExpr(MCExpr::SymbolRef), Symbol(_Symbol), Kind(_Kind) {
+  /// MCAsmInfo that is used to print symbol variants correctly.
+  const MCAsmInfo *MAI;
+
+  explicit MCSymbolRefExpr(const MCSymbol *_Symbol, VariantKind _Kind,
+                           const MCAsmInfo *_MAI)
+    : MCExpr(MCExpr::SymbolRef), Symbol(_Symbol), Kind(_Kind), MAI(_MAI) {
     assert(Symbol);
+    assert(MAI);
   }
 
 public:
@@ -280,6 +292,7 @@ public:
   /// @{
 
   const MCSymbol &getSymbol() const { return *Symbol; }
+  const MCAsmInfo &getMCAsmInfo() const { return *MAI; }
 
   VariantKind getKind() const { return Kind; }