mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
simplify padding, just fold it into the earlier resize.
llvm-svn: 56880
This commit is contained in:
@@ -518,18 +518,13 @@ Action::ExprResult Sema::ActOnNumericConstant(const Token &Tok) {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user