From a26da8503c817f1c50354b47dc1d19ca8aab095f Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 17 Nov 2009 23:12:20 +0000 Subject: Pass source locations of identifiers referenced by @class through Action::ActOnForwardClassDeclaration(). llvm-svn: 89162 --- clang/lib/Parse/ParseObjc.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/Parse/ParseObjc.cpp') diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 6ca2314ef4f..6a2c2135539 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -61,6 +61,8 @@ Parser::DeclPtrTy Parser::ParseObjCAtDirectives() { Parser::DeclPtrTy Parser::ParseObjCAtClassDeclaration(SourceLocation atLoc) { ConsumeToken(); // the identifier "class" llvm::SmallVector ClassNames; + llvm::SmallVector ClassLocs; + while (1) { if (Tok.isNot(tok::identifier)) { @@ -69,6 +71,7 @@ Parser::DeclPtrTy Parser::ParseObjCAtClassDeclaration(SourceLocation atLoc) { return DeclPtrTy(); } ClassNames.push_back(Tok.getIdentifierInfo()); + ClassLocs.push_back(Tok.getLocation()); ConsumeToken(); if (Tok.isNot(tok::comma)) @@ -81,8 +84,9 @@ Parser::DeclPtrTy Parser::ParseObjCAtClassDeclaration(SourceLocation atLoc) { if (ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@class")) return DeclPtrTy(); - return Actions.ActOnForwardClassDeclaration(atLoc, - &ClassNames[0], ClassNames.size()); + return Actions.ActOnForwardClassDeclaration(atLoc, ClassNames.data(), + ClassLocs.data(), + ClassNames.size()); } /// -- cgit v1.2.3