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 <NSCopying>
^
instead of this:
t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^
Add a new IdentifierLocPair typedef which is just a pair<IdentifierInfo*, SourceLocation>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53883 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 95344c4..1ac26a3 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -413,8 +413,11 @@
ConsumeToken(); // The identifier
if (Tok.is(tok::less)) {
SourceLocation endProtoLoc;
- llvm::SmallVector<IdentifierInfo *, 8> ProtocolRefs;
+ llvm::SmallVector<IdentifierLocPair, 8> ProtocolRefs;
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);
@@ -553,7 +556,7 @@
case tok::less:
if (!DS.hasTypeSpecifier()) {
SourceLocation endProtoLoc;
- llvm::SmallVector<IdentifierInfo *, 8> ProtocolRefs;
+ llvm::SmallVector<IdentifierLocPair, 8> ProtocolRefs;
ParseObjCProtocolReferences(ProtocolRefs, endProtoLoc);
llvm::SmallVector<DeclTy *, 8> *ProtocolDecl =
new llvm::SmallVector<DeclTy *, 8>;