projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid the deprecated GetVersionEx API
[oota-llvm.git]
/
lib
/
TableGen
/
TGLexer.cpp
diff --git
a/lib/TableGen/TGLexer.cpp
b/lib/TableGen/TGLexer.cpp
index 1a876232e27d377aa269341985ea48af14b8c79d..63b85842d6a9e68910ecd32eb78be621abbb1ed7 100644
(file)
--- a/
lib/TableGen/TGLexer.cpp
+++ b/
lib/TableGen/TGLexer.cpp
@@
-28,8
+28,8
@@
using namespace llvm;
TGLexer::TGLexer(SourceMgr &SM) : SrcMgr(SM) {
CurBuffer = SrcMgr.getMainFileID();
TGLexer::TGLexer(SourceMgr &SM) : SrcMgr(SM) {
CurBuffer = SrcMgr.getMainFileID();
- CurBuf = SrcMgr.getMemoryBuffer(CurBuffer);
- CurPtr = CurBuf
->getBufferStart
();
+ CurBuf = SrcMgr.getMemoryBuffer(CurBuffer)
->getBuffer()
;
+ CurPtr = CurBuf
.begin
();
TokStart = nullptr;
}
TokStart = nullptr;
}
@@
-52,7
+52,7
@@
int TGLexer::getNextChar() {
case 0: {
// A nul character in the stream is either the end of the current buffer or
// a random nul in the file. Disambiguate that here.
case 0: {
// A nul character in the stream is either the end of the current buffer or
// a random nul in the file. Disambiguate that here.
- if (CurPtr-1 != CurBuf
->getBufferE
nd())
+ if (CurPtr-1 != CurBuf
.e
nd())
return 0; // Just whitespace.
// If this is the end of an included file, pop the parent file off the
return 0; // Just whitespace.
// If this is the end of an included file, pop the parent file off the
@@
-60,7
+60,7
@@
int TGLexer::getNextChar() {
SMLoc ParentIncludeLoc = SrcMgr.getParentIncludeLoc(CurBuffer);
if (ParentIncludeLoc != SMLoc()) {
CurBuffer = SrcMgr.FindBufferContainingLoc(ParentIncludeLoc);
SMLoc ParentIncludeLoc = SrcMgr.getParentIncludeLoc(CurBuffer);
if (ParentIncludeLoc != SMLoc()) {
CurBuffer = SrcMgr.FindBufferContainingLoc(ParentIncludeLoc);
- CurBuf = SrcMgr.getMemoryBuffer(CurBuffer);
+ CurBuf = SrcMgr.getMemoryBuffer(CurBuffer)
->getBuffer()
;
CurPtr = ParentIncludeLoc.getPointer();
return getNextChar();
}
CurPtr = ParentIncludeLoc.getPointer();
return getNextChar();
}
@@
-187,7
+187,7
@@
tgtok::TokKind TGLexer::LexString() {
while (*CurPtr != '"') {
// If we hit the end of the buffer, report an error.
while (*CurPtr != '"') {
// If we hit the end of the buffer, report an error.
- if (*CurPtr == 0 && CurPtr == CurBuf
->getBufferE
nd())
+ if (*CurPtr == 0 && CurPtr == CurBuf
.e
nd())
return ReturnError(StrStart, "End of file in string literal");
if (*CurPtr == '\n' || *CurPtr == '\r')
return ReturnError(StrStart, "End of file in string literal");
if (*CurPtr == '\n' || *CurPtr == '\r')
@@
-220,7
+220,7
@@
tgtok::TokKind TGLexer::LexString() {
// If we hit the end of the buffer, report an error.
case '\0':
// If we hit the end of the buffer, report an error.
case '\0':
- if (CurPtr == CurBuf
->getBufferE
nd())
+ if (CurPtr == CurBuf
.e
nd())
return ReturnError(StrStart, "End of file in string literal");
// FALL THROUGH
default:
return ReturnError(StrStart, "End of file in string literal");
// FALL THROUGH
default:
@@
-319,8
+319,8
@@
bool TGLexer::LexInclude() {
}
Dependencies.insert(std::make_pair(IncludedFile, getLoc()));
// Save the line number and lex buffer of the includer.
}
Dependencies.insert(std::make_pair(IncludedFile, getLoc()));
// Save the line number and lex buffer of the includer.
- CurBuf = SrcMgr.getMemoryBuffer(CurBuffer);
- CurPtr = CurBuf
->getBufferStart
();
+ CurBuf = SrcMgr.getMemoryBuffer(CurBuffer)
->getBuffer()
;
+ CurPtr = CurBuf
.begin
();
return false;
}
return false;
}
@@
-333,7
+333,7
@@
void TGLexer::SkipBCPLComment() {
return; // Newline is end of comment.
case 0:
// If this is the end of the buffer, end the comment.
return; // Newline is end of comment.
case 0:
// If this is the end of the buffer, end the comment.
- if (CurPtr == CurBuf
->getBufferE
nd())
+ if (CurPtr == CurBuf
.e
nd())
return;
break;
}
return;
break;
}
@@
-411,7
+411,7
@@
tgtok::TokKind TGLexer::LexNumber() {
if (CurPtr == NumStart)
return ReturnError(CurPtr-2, "Invalid binary number");
CurIntVal = strtoll(NumStart, nullptr, 2);
if (CurPtr == NumStart)
return ReturnError(CurPtr-2, "Invalid binary number");
CurIntVal = strtoll(NumStart, nullptr, 2);
- return tgtok::IntVal;
+ return tgtok::
Binary
IntVal;
}
}
}
}
@@
-471,6
+471,7
@@
tgtok::TokKind TGLexer::LexExclaim() {
.Case("tail", tgtok::XTail)
.Case("con", tgtok::XConcat)
.Case("add", tgtok::XADD)
.Case("tail", tgtok::XTail)
.Case("con", tgtok::XConcat)
.Case("add", tgtok::XADD)
+ .Case("and", tgtok::XAND)
.Case("shl", tgtok::XSHL)
.Case("sra", tgtok::XSRA)
.Case("srl", tgtok::XSRL)
.Case("shl", tgtok::XSHL)
.Case("sra", tgtok::XSRA)
.Case("srl", tgtok::XSRL)