aboutsummaryrefslogtreecommitdiffstats
path: root/lib/TableGen/TGLexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/TableGen/TGLexer.h')
-rw-r--r--lib/TableGen/TGLexer.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/TableGen/TGLexer.h b/lib/TableGen/TGLexer.h
index a2c95ca..1f750fc 100644
--- a/lib/TableGen/TGLexer.h
+++ b/lib/TableGen/TGLexer.h
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef TGLEXER_H
-#define TGLEXER_H
+#ifndef LLVM_LIB_TABLEGEN_TGLEXER_H
+#define LLVM_LIB_TABLEGEN_TGLEXER_H
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DataTypes.h"
@@ -47,11 +47,15 @@ namespace tgtok {
MultiClass, String,
// !keywords.
- XConcat, XADD, XSRA, XSRL, XSHL, XListConcat, XStrConcat, XCast, XSubst,
- XForEach, XHead, XTail, XEmpty, XIf, XEq,
+ XConcat, XADD, XAND, XSRA, XSRL, XSHL, XListConcat, XStrConcat, XCast,
+ XSubst, XForEach, XHead, XTail, XEmpty, XIf, XEq,
// Integer value.
IntVal,
+
+ // Binary constant. Note that these are sized according to the number of
+ // bits given.
+ BinaryIntVal,
// String valued tokens.
Id, StrVal, VarName, CodeFragment
@@ -105,6 +109,11 @@ public:
assert(CurCode == tgtok::IntVal && "This token isn't an integer");
return CurIntVal;
}
+ std::pair<int64_t, unsigned> getCurBinaryIntVal() const {
+ assert(CurCode == tgtok::BinaryIntVal &&
+ "This token isn't a binary integer");
+ return std::make_pair(CurIntVal, (CurPtr - TokStart)-2);
+ }
SMLoc getLoc() const;