diff options
author | Alex Lorenz <arphaman@gmail.com> | 2015-06-23 23:42:28 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2015-06-23 23:42:28 +0000 |
commit | 240fc1e0aab8558ed9fa5da1ee74530a9262e7d5 (patch) | |
tree | 3effc1129db461b93703c506d591ddfb9596af74 /llvm/lib/CodeGen/MIRParser/MILexer.h | |
parent | 6a24811d8781081535598a274061a8768e7c850e (diff) | |
download | bcm5719-llvm-240fc1e0aab8558ed9fa5da1ee74530a9262e7d5.tar.gz bcm5719-llvm-240fc1e0aab8558ed9fa5da1ee74530a9262e7d5.zip |
MIR Serialization: Serialize immediate machine operands.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10573
llvm-svn: 240481
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MILexer.h')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h index 24cbf7d72f3..df8b6cb2026 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.h +++ b/llvm/lib/CodeGen/MIRParser/MILexer.h @@ -15,6 +15,7 @@ #ifndef LLVM_LIB_CODEGEN_MIRPARSER_MILEXER_H #define LLVM_LIB_CODEGEN_MIRPARSER_MILEXER_H +#include "llvm/ADT/APSInt.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/STLExtras.h" #include <functional> @@ -36,16 +37,23 @@ struct MIToken { // Identifier tokens Identifier, - NamedRegister + NamedRegister, + + // Other tokens + IntegerLiteral }; private: TokenKind Kind; StringRef Range; + APSInt IntVal; public: MIToken(TokenKind Kind, StringRef Range) : Kind(Kind), Range(Range) {} + MIToken(TokenKind Kind, StringRef Range, const APSInt &IntVal) + : Kind(Kind), Range(Range), IntVal(IntVal) {} + TokenKind kind() const { return Kind; } bool isError() const { return Kind == Error; } @@ -59,6 +67,8 @@ public: StringRef::iterator location() const { return Range.begin(); } StringRef stringValue() const { return Range; } + + const APSInt &integerValue() const { return IntVal; } }; /// Consume a single machine instruction token in the given source and return |