[ms-inline asm] Add the isOffsetOf() function.
authorChad Rosier <mcrosier@apple.com>
Mon, 22 Oct 2012 19:50:35 +0000 (19:50 +0000)
committerChad Rosier <mcrosier@apple.com>
Mon, 22 Oct 2012 19:50:35 +0000 (19:50 +0000)
Part of rdar://12470317

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166436 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCParser/MCParsedAsmOperand.h
lib/Target/X86/AsmParser/X86AsmParser.cpp

index 7d0914ebb49105fdcd93cf9de51cc4bbfb2fdb52..35f47c0b9c817d90690c0d86e75a331dec0dd7c7 100644 (file)
@@ -64,6 +64,11 @@ public:
   /// getEndLoc - Get the location of the last token of this operand.
   virtual SMLoc getEndLoc() const = 0;
 
+  /// isOffsetOf - Do we need to emit code to get the offset of the variable,
+  /// rather then the value of the variable?   Only valid when parsing MS-style
+  /// inline assembly.
+  virtual bool isOffsetOf() const { return false; }
+
   /// needSizeDirective - Do we need to emit a sizing directive for this
   /// operand?  Only valid when parsing MS-style inline assembly.
   virtual bool needSizeDirective() const { return false; }
index 63cce6cbc869f532d7cb668a1a547d53502c3ba9..9689180afdb371786f69514bb14a89edb274698f 100644 (file)
@@ -320,6 +320,11 @@ struct X86Operand : public MCParsedAsmOperand {
     return Mem.Size;
   }
 
+  bool isOffsetOf() const {
+    assert(Kind == Memory && "Invalid access!");
+    return Mem.OffsetOf;
+  }
+
   bool needSizeDirective() const {
     assert(Kind == Memory && "Invalid access!");
     return Mem.NeedSizeDir;