summaryrefslogtreecommitdiffstats
path: root/clang/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-06 05:22:26 +0000
committerChris Lattner <sabre@nondot.org>2006-10-06 05:22:26 +0000
commitd3e9895b9aa6d312733d0523aee222198a4bcfcd (patch)
treedd971b780a71431431688c1f50582267cbe3dda3 /clang/Lex/Lexer.cpp
parent19acaadc2bba4cf0f38c5c4630a9b7eb35d0bc56 (diff)
downloadbcm5719-llvm-d3e9895b9aa6d312733d0523aee222198a4bcfcd.tar.gz
bcm5719-llvm-d3e9895b9aa6d312733d0523aee222198a4bcfcd.zip
Initial support for semantic analysis and AST building for StringExpr nodes.
llvm-svn: 38960
Diffstat (limited to 'clang/Lex/Lexer.cpp')
-rw-r--r--clang/Lex/Lexer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/Lex/Lexer.cpp b/clang/Lex/Lexer.cpp
index c686d918262..4bceedd4124 100644
--- a/clang/Lex/Lexer.cpp
+++ b/clang/Lex/Lexer.cpp
@@ -444,7 +444,7 @@ void Lexer::LexNumericConstant(LexerToken &Result, const char *CurPtr) {
/// LexStringLiteral - Lex the remainder of a string literal, after having lexed
/// either " or L".
-void Lexer::LexStringLiteral(LexerToken &Result, const char *CurPtr) {
+void Lexer::LexStringLiteral(LexerToken &Result, const char *CurPtr, bool Wide){
const char *NulCharacter = 0; // Does this string contain the \0 character?
char C = getAndAdvanceChar(CurPtr, Result);
@@ -468,7 +468,7 @@ void Lexer::LexStringLiteral(LexerToken &Result, const char *CurPtr) {
// If a nul character existed in the string, warn about it.
if (NulCharacter) Diag(NulCharacter, diag::null_in_string);
- Result.SetKind(tok::string_literal);
+ Result.SetKind(Wide ? tok::wide_string_literal : tok::string_literal);
// Update the location of the token as well as the BufferPtr instance var.
FormTokenWithChars(Result, CurPtr);
@@ -1104,7 +1104,8 @@ LexNextToken:
// Wide string literal.
if (Char == '"')
- return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result));
+ return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result),
+ true);
// Wide character constant.
if (Char == '\'')
@@ -1143,7 +1144,7 @@ LexNextToken:
case '"':
// Notify MIOpt that we read a non-whitespace/non-comment token.
MIOpt.ReadToken();
- return LexStringLiteral(Result, CurPtr);
+ return LexStringLiteral(Result, CurPtr, false);
// C99 6.4.6: Punctuators.
case '?':
OpenPOWER on IntegriCloud