[cfe-commits] r56880 - /cfe/trunk/lib/Sema/SemaExpr.cpp
Chris Lattner
sabre at nondot.org
Tue Sep 30 13:53:45 PDT 2008
Author: lattner
Date: Tue Sep 30 15:53:45 2008
New Revision: 56880
URL: http://llvm.org/viewvc/llvm-project?rev=56880&view=rev
Log:
simplify padding, just fold it into the earlier resize.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=56880&r1=56879&r2=56880&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Sep 30 15:53:45 2008
@@ -518,18 +518,13 @@
Tok.getLocation()));
}
llvm::SmallString<512> IntegerBuffer;
- IntegerBuffer.resize(Tok.getLength());
+ // Add padding so that NumericLiteralParser can overread by one character.
+ IntegerBuffer.resize(Tok.getLength()+1);
const char *ThisTokBegin = &IntegerBuffer[0];
// Get the spelling of the token, which eliminates trigraphs, etc.
unsigned ActualLength = PP.getSpelling(Tok, ThisTokBegin);
- // Add padding so that NumericLiteralParser can overread by one character.
- if (!IntegerBuffer.empty()) {
- IntegerBuffer.push_back(' ');
- ThisTokBegin = &IntegerBuffer[0];
- }
-
NumericLiteralParser Literal(ThisTokBegin, ThisTokBegin+ActualLength,
Tok.getLocation(), PP);
if (Literal.hadError)
More information about the cfe-commits
mailing list