summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-07-26 01:53:50 +0000
committerChris Lattner <sabre@nondot.org>2008-07-26 01:53:50 +0000
commitbc76297674a56c4dd182443d4ce817c4561fef50 (patch)
tree246467ff7bce6a7da1a24bc94e5cef93571368f0 /clang/lib/Parse/ParseDecl.cpp
parent16fac4f2adb5b08f3f2f7c400f64789fc19406ae (diff)
downloadbcm5719-llvm-bc76297674a56c4dd182443d4ce817c4561fef50.tar.gz
bcm5719-llvm-bc76297674a56c4dd182443d4ce817c4561fef50.zip
make DeclSpec manage its own protocol qualifier list memory instead of having
clients allocate the memory and it delete it. llvm-svn: 54087
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 98c2d897d5d..5ed1a61769e 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -435,12 +435,11 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) {
ParseObjCProtocolReferences(ProtocolRefs, EndProtoLoc);
// FIXME: New'ing this here seems wrong, why not have the action do it?
- llvm::SmallVector<DeclTy *, 8> *ProtocolDecl =
- new llvm::SmallVector<DeclTy *, 8>;
- DS.setProtocolQualifiers(ProtocolDecl);
+ llvm::SmallVector<DeclTy *, 8> ProtocolDecl;
Actions.FindProtocolDeclaration(Loc,
&ProtocolRefs[0], ProtocolRefs.size(),
- *ProtocolDecl);
+ ProtocolDecl);
+ DS.setProtocolQualifiers(&ProtocolDecl[0], ProtocolDecl.size());
DS.SetRangeEnd(EndProtoLoc);
@@ -576,12 +575,11 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) {
SourceLocation EndProtoLoc;
llvm::SmallVector<IdentifierLocPair, 8> ProtocolRefs;
ParseObjCProtocolReferences(ProtocolRefs, EndProtoLoc);
- llvm::SmallVector<DeclTy *, 8> *ProtocolDecl =
- new llvm::SmallVector<DeclTy *, 8>;
- DS.setProtocolQualifiers(ProtocolDecl);
+ llvm::SmallVector<DeclTy *, 8> ProtocolDecl;
Actions.FindProtocolDeclaration(Loc,
&ProtocolRefs[0], ProtocolRefs.size(),
- *ProtocolDecl);
+ ProtocolDecl);
+ DS.setProtocolQualifiers(&ProtocolDecl[0], ProtocolDecl.size());
DS.SetRangeEnd(EndProtoLoc);
Diag(Loc, diag::warn_objc_protocol_qualifier_missing_id,
OpenPOWER on IntegriCloud