[llvm-commits] [llvm] r67589 - in /llvm/tags/Apple/llvmCore-2104.1: test/TableGen/String.td utils/TableGen/TGLexer.cpp
Bill Wendling
isanbard at gmail.com
Mon Mar 23 18:05:56 PDT 2009
Author: void
Date: Mon Mar 23 20:05:56 2009
New Revision: 67589
URL: http://llvm.org/viewvc/llvm-project?rev=67589&view=rev
Log:
Revert r66949 and r66957 from Dib.
Removed:
llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td
Modified:
llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp
Removed: llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td?rev=67588&view=auto
==============================================================================
--- llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td (original)
+++ llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td (removed)
@@ -1,5 +0,0 @@
-// RUN: tblgen %s
-class x {
- string y = "missing terminating '\"' character";
-}
-
Modified: llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp?rev=67589&r1=67588&r2=67589&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp (original)
+++ llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp Mon Mar 23 20:05:56 2009
@@ -151,8 +151,6 @@
tgtok::TokKind TGLexer::LexString() {
const char *StrStart = CurPtr;
- CurStrVal = "";
-
while (*CurPtr != '"') {
// If we hit the end of the buffer, report an error.
if (*CurPtr == 0 && CurPtr == CurBuf->getBufferEnd())
@@ -161,41 +159,10 @@
if (*CurPtr == '\n' || *CurPtr == '\r')
return ReturnError(StrStart, "End of line in string literal");
- if (*CurPtr != '\\') {
- CurStrVal += *CurPtr++;
- continue;
- }
-
++CurPtr;
-
- switch (*CurPtr) {
- case '\\': case '\'': case '"':
- // These turn into their literal character.
- CurStrVal += *CurPtr++;
- break;
- case 't':
- CurStrVal += "\\t";
- ++CurPtr;
- break;
- case 'n':
- CurStrVal += "\\n";
- ++CurPtr;
- break;
-
- case '\n':
- case '\r':
- return ReturnError(CurPtr, "escaped newlines not supported in tblgen");
-
- // If we hit the end of the buffer, report an error.
- case '\0':
- if (CurPtr == CurBuf->getBufferEnd())
- return ReturnError(StrStart, "End of file in string literal");
- // FALL THROUGH
- default:
- return ReturnError(CurPtr, "invalid escape in string literal");
- }
}
+ CurStrVal.assign(StrStart, CurPtr);
++CurPtr;
return tgtok::StrVal;
}
More information about the llvm-commits
mailing list