summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-11 05:28:37 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-11 05:28:37 +0000
commit7f4945aa9ccb178bb494d6b619b9cd09e69c3527 (patch)
tree10f3170ba6f9ff5a1a05cafc16aa7a555d42260f /clang/lib/Frontend
parentc053cbbc4d4123060b1142538f2cdd658d26bbc8 (diff)
downloadbcm5719-llvm-7f4945aa9ccb178bb494d6b619b9cd09e69c3527.tar.gz
bcm5719-llvm-7f4945aa9ccb178bb494d6b619b9cd09e69c3527.zip
Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext. This addresses these strings getting leaked when using a BumpPtrAllocator (in ASTContext). Fixes: <rdar://problem/7636765> llvm-svn: 95853
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/PCHReaderDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp
index 43f0b2c5cda..29f5556b193 100644
--- a/clang/lib/Frontend/PCHReaderDecl.cpp
+++ b/clang/lib/Frontend/PCHReaderDecl.cpp
@@ -446,7 +446,7 @@ Attr *PCHReader::ReadAttributes() {
#define STRING_ATTR(Name) \
case Attr::Name: \
- New = ::new (*Context) Name##Attr(ReadString(Record, Idx)); \
+ New = ::new (*Context) Name##Attr(*Context, ReadString(Record, Idx)); \
break
#define UNSIGNED_ATTR(Name) \
@@ -497,7 +497,7 @@ Attr *PCHReader::ReadAttributes() {
std::string Type = ReadString(Record, Idx);
unsigned FormatIdx = Record[Idx++];
unsigned FirstArg = Record[Idx++];
- New = ::new (*Context) FormatAttr(Type, FormatIdx, FirstArg);
+ New = ::new (*Context) FormatAttr(*Context, Type, FormatIdx, FirstArg);
break;
}
OpenPOWER on IntegriCloud