diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-18 05:49:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-18 05:49:11 +0000 |
commit | 726e168dc09fb23f53c7b004f8e919421ee91806 (patch) | |
tree | 31e28ff92e011dd2ffbc9bb0efdc83405749c99f /lib/Sema/SemaExprObjC.cpp | |
parent | b103f01e5e2072c04ea5619c587a2b7ff2e63022 (diff) |
change the StringLiteral AST node to track all of the SourceLocations of
the various PPTokens that are pasted together to make it. In the course
of working on this, I discovered ParseObjCStringLiteral which needs some
work. I'll tackle it next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 3e99482772..b0b5367790 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -29,10 +29,12 @@ Sema::ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs, unsigned Length = 0; for (unsigned i = 0; i < NumStrings; i++) Length += static_cast<StringLiteral *>(Strings[i])->getByteLength(); - char *strBuf = new char [Length]; + + // FIXME: This should not be allocated by SEMA! + char *strBuf = new char[Length]; char *p = strBuf; bool isWide = false; - for (unsigned i = 0; i < NumStrings; i++) { + for (unsigned i = 0; i != NumStrings; ++i) { S = static_cast<StringLiteral *>(Strings[i]); if (S->isWide()) isWide = true; @@ -40,9 +42,10 @@ Sema::ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs, p += S->getByteLength(); S->Destroy(Context); } - S = new (Context, 8) StringLiteral(Context, strBuf, Length, isWide, - Context.getPointerType(Context.CharTy), - AtLoc, EndLoc); + // FIXME: PASS LOCATIONS PROPERLY. + S = new (Context) StringLiteral(Context, strBuf, Length, isWide, + Context.getPointerType(Context.CharTy), + AtLoc); } if (CheckBuiltinCFStringArgument(S)) |