Added a Register token to AsmToken and the appropriate
authorSean Callanan <scallanan@apple.com>
Fri, 22 Jan 2010 22:42:22 +0000 (22:42 +0000)
committerSean Callanan <scallanan@apple.com>
Fri, 22 Jan 2010 22:42:22 +0000 (22:42 +0000)
accessor method for its value.

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

include/llvm/MC/MCParser/MCAsmLexer.h

index bec6ede4ae2bae1d078625d73a394be3c7b27b48..043c363308625d38307ab7332d072b64f304fdd7 100644 (file)
@@ -33,6 +33,9 @@ public:
     // Integer values.
     Integer,
     
+    // Register values (stored in IntVal).  Only used by TargetAsmLexer.
+    Register,
+    
     // No-value.
     EndOfStatement,
     Colon,
@@ -96,6 +99,13 @@ public:
     assert(Kind == Integer && "This token isn't an integer!");
     return IntVal; 
   }
+  
+  /// getRegVal - Get the register number for the current token, which should
+  /// be a register.
+  unsigned getRegVal() const {
+    assert(Kind == Register && "This token isn't a register!");
+    return static_cast<unsigned>(IntVal);
+  }
 };
 
 /// MCAsmLexer - Generic assembler lexer interface, for use by target specific