MIR Serialization: Serialize the pointer IR expression values in the machine
[oota-llvm.git] / lib / CodeGen / MIRParser / MILexer.h
index d0ae379097c9bf90d238fc8f94c135c13963cfce..ff54aa3554d87d8a951daf08b388b585658ac2ff 100644 (file)
@@ -30,6 +30,7 @@ struct MIToken {
     // Markers
     Eof,
     Error,
+    Newline,
 
     // Tokens with no info.
     comma,
@@ -40,19 +41,25 @@ struct MIToken {
     exclaim,
     lparen,
     rparen,
+    lbrace,
+    rbrace,
     plus,
     minus,
 
     // Keywords
     kw_implicit,
     kw_implicit_define,
+    kw_def,
     kw_dead,
     kw_killed,
     kw_undef,
+    kw_internal,
     kw_early_clobber,
     kw_debug_use,
+    kw_tied_def,
     kw_frame_setup,
     kw_debug_location,
+    kw_cfi_same_value,
     kw_cfi_offset,
     kw_cfi_def_cfa_register,
     kw_cfi_def_cfa_offset,
@@ -74,12 +81,24 @@ struct MIToken {
     kw_got,
     kw_jump_table,
     kw_constant_pool,
+    kw_call_entry,
     kw_liveout,
+    kw_address_taken,
+    kw_landing_pad,
+    kw_liveins,
+    kw_successors,
+
+    // Named metadata keywords
+    md_tbaa,
+    md_alias_scope,
+    md_noalias,
+    md_range,
 
     // Identifier tokens
     Identifier,
     IntegerType,
     NamedRegister,
+    MachineBasicBlockLabel,
     MachineBasicBlock,
     StackObject,
     FixedStackObject,
@@ -96,6 +115,8 @@ struct MIToken {
     NamedIRBlock,
     IRBlock,
     NamedIRValue,
+    IRValue,
+    QuotedIRValue // `<constant value>`
   };
 
 private:
@@ -118,6 +139,10 @@ public:
 
   bool isError() const { return Kind == Error; }
 
+  bool isNewlineOrEOF() const { return Kind == Newline || Kind == Eof; }
+
+  bool isErrorOrEOF() const { return Kind == Error || Kind == Eof; }
+
   bool isRegister() const {
     return Kind == NamedRegister || Kind == underscore ||
            Kind == VirtualRegister;
@@ -125,7 +150,8 @@ public:
 
   bool isRegisterFlag() const {
     return Kind == kw_implicit || Kind == kw_implicit_define ||
-           Kind == kw_dead || Kind == kw_killed || Kind == kw_undef ||
+           Kind == kw_def || Kind == kw_dead || Kind == kw_killed ||
+           Kind == kw_undef || Kind == kw_internal ||
            Kind == kw_early_clobber || Kind == kw_debug_use;
   }
 
@@ -149,10 +175,10 @@ public:
 
   bool hasIntegerValue() const {
     return Kind == IntegerLiteral || Kind == MachineBasicBlock ||
-           Kind == StackObject || Kind == FixedStackObject ||
-           Kind == GlobalValue || Kind == VirtualRegister ||
-           Kind == ConstantPoolItem || Kind == JumpTableIndex ||
-           Kind == IRBlock;
+           Kind == MachineBasicBlockLabel || Kind == StackObject ||
+           Kind == FixedStackObject || Kind == GlobalValue ||
+           Kind == VirtualRegister || Kind == ConstantPoolItem ||
+           Kind == JumpTableIndex || Kind == IRBlock || Kind == IRValue;
   }
 };