From d7352d6801f3bae265c75e9d2d9d2eba3d1c802d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 21 Jul 2008 22:17:28 +0000 Subject: minor cleanup to the actions interface to pass around SmallVectorImpl instead of a specific smallvector size. Fix protocol lists to pass down proper location info, so we get diagnostics like this: t.m:3:35: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever' @interface NSWhatever : NSObject ^ instead of this: t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever' @interface NSWhatever : NSObject ^ Add a new IdentifierLocPair typedef which is just a pair llvm-svn: 53883 --- clang/lib/Parse/ParseDecl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'clang/lib/Parse/ParseDecl.cpp') diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 95344c438ef..1ac26a309fa 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -413,8 +413,11 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) { ConsumeToken(); // The identifier if (Tok.is(tok::less)) { SourceLocation endProtoLoc; - llvm::SmallVector ProtocolRefs; + llvm::SmallVector ProtocolRefs; ParseObjCProtocolReferences(ProtocolRefs, endProtoLoc); + + // FIXME: New'ing this here seems wrong, why not have the action do + // it? llvm::SmallVector *ProtocolDecl = new llvm::SmallVector; DS.setProtocolQualifiers(ProtocolDecl); @@ -553,7 +556,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) { case tok::less: if (!DS.hasTypeSpecifier()) { SourceLocation endProtoLoc; - llvm::SmallVector ProtocolRefs; + llvm::SmallVector ProtocolRefs; ParseObjCProtocolReferences(ProtocolRefs, endProtoLoc); llvm::SmallVector *ProtocolDecl = new llvm::SmallVector; -- cgit v1.2.3