aboutsummaryrefslogtreecommitdiff
path: root/lib/TableGen/TGLexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/TableGen/TGLexer.cpp')
-rw-r--r--lib/TableGen/TGLexer.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/TableGen/TGLexer.cpp b/lib/TableGen/TGLexer.cpp
index 63b85842d6a9..5d6f7c23e0b6 100644
--- a/lib/TableGen/TGLexer.cpp
+++ b/lib/TableGen/TGLexer.cpp
@@ -15,11 +15,13 @@
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Config/config.h" // for strtoull()/strtoll() define
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/TableGen/Error.h"
#include <cctype>
#include <cerrno>
+#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@@ -155,7 +157,7 @@ tgtok::TokKind TGLexer::LexToken() {
case '0': case '1':
if (NextChar == 'b')
return LexNumber();
- // Fallthrough
+ LLVM_FALLTHROUGH;
case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9':
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
@@ -222,7 +224,7 @@ tgtok::TokKind TGLexer::LexString() {
case '\0':
if (CurPtr == CurBuf.end())
return ReturnError(StrStart, "End of file in string literal");
- // FALL THROUGH
+ LLVM_FALLTHROUGH;
default:
return ReturnError(CurPtr, "invalid escape in string literal");
}
@@ -246,7 +248,6 @@ tgtok::TokKind TGLexer::LexVarName() {
return tgtok::VarName;
}
-
tgtok::TokKind TGLexer::LexIdentifier() {
// The first letter is [a-zA-Z_#].
const char *IdentStart = TokStart;
@@ -301,7 +302,6 @@ bool TGLexer::LexInclude() {
std::string Filename = CurStrVal;
std::string IncludedFile;
-
CurBuffer = SrcMgr.AddIncludeFile(Filename, SMLoc::getFromPointer(CurPtr),
IncludedFile);
if (!CurBuffer) {
@@ -326,7 +326,7 @@ bool TGLexer::LexInclude() {
void TGLexer::SkipBCPLComment() {
++CurPtr; // skip the second slash.
- while (1) {
+ while (true) {
switch (*CurPtr) {
case '\n':
case '\r':
@@ -348,7 +348,7 @@ bool TGLexer::SkipCComment() {
++CurPtr; // skip the star.
unsigned CommentDepth = 1;
- while (1) {
+ while (true) {
int CurChar = getNextChar();
switch (CurChar) {
case EOF:
@@ -436,7 +436,7 @@ tgtok::TokKind TGLexer::LexBracket() {
return tgtok::l_square;
++CurPtr;
const char *CodeStart = CurPtr;
- while (1) {
+ while (true) {
int Char = getNextChar();
if (Char == EOF) break;
@@ -472,6 +472,7 @@ tgtok::TokKind TGLexer::LexExclaim() {
.Case("con", tgtok::XConcat)
.Case("add", tgtok::XADD)
.Case("and", tgtok::XAND)
+ .Case("or", tgtok::XOR)
.Case("shl", tgtok::XSHL)
.Case("sra", tgtok::XSRA)
.Case("srl", tgtok::XSRL)
@@ -485,4 +486,3 @@ tgtok::TokKind TGLexer::LexExclaim() {
return Kind != tgtok::Error ? Kind : ReturnError(Start-1, "Unknown operator");
}
-