[cfe-commits] r43051 - in /cfe/trunk: Parse/ParseObjc.cpp Sema/Sema.h Sema/SemaExpr.cpp clang.xcodeproj/project.pbxproj include/clang/AST/Expr.h include/clang/Parse/Action.h include/clang/Parse/Parser.h
Fariborz Jahanian
fjahanian at apple.com
Tue Oct 16 16:21:03 PDT 2007
Author: fjahanian
Date: Tue Oct 16 18:21:02 2007
New Revision: 43051
URL: http://llvm.org/viewvc/llvm-project?rev=43051&view=rev
Log:
Fix location processing of @selector: the range should include the @ sign.
Modified:
cfe/trunk/Parse/ParseObjc.cpp
cfe/trunk/Sema/Sema.h
cfe/trunk/Sema/SemaExpr.cpp
cfe/trunk/clang.xcodeproj/project.pbxproj
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/Parse/Action.h
cfe/trunk/include/clang/Parse/Parser.h
Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=43051&r1=43050&r2=43051&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Tue Oct 16 18:21:02 2007
@@ -1128,9 +1128,9 @@
case tok::objc_encode:
return ParsePostfixExpressionSuffix(ParseObjCEncodeExpression(AtLoc));
case tok::objc_protocol:
- return ParsePostfixExpressionSuffix(ParseObjCProtocolExpression());
+ return ParsePostfixExpressionSuffix(ParseObjCProtocolExpression(AtLoc));
case tok::objc_selector:
- return ParsePostfixExpressionSuffix(ParseObjCSelectorExpression());
+ return ParsePostfixExpressionSuffix(ParseObjCSelectorExpression(AtLoc));
default:
Diag(AtLoc, diag::err_unexpected_at);
SkipUntil(tok::semi);
@@ -1282,7 +1282,7 @@
/// objc-protocol-expression
/// @protocol ( protocol-name )
-Parser::ExprResult Parser::ParseObjCProtocolExpression()
+Parser::ExprResult Parser::ParseObjCProtocolExpression(SourceLocation AtLoc)
{
SourceLocation ProtoLoc = ConsumeToken();
@@ -1309,7 +1309,7 @@
/// objc-selector-expression
/// @selector '(' objc-keyword-selector ')'
-Parser::ExprResult Parser::ParseObjCSelectorExpression()
+Parser::ExprResult Parser::ParseObjCSelectorExpression(SourceLocation AtLoc)
{
SourceLocation SelectorLoc = ConsumeToken();
@@ -1347,6 +1347,6 @@
SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
Selector Sel = PP.getSelectorTable().getSelector(KeyIdents.size(),
&KeyIdents[0]);
- return Actions.ParseObjCSelectorExpression(Sel, SelectorLoc, LParenLoc,
+ return Actions.ParseObjCSelectorExpression(Sel, AtLoc, SelectorLoc, LParenLoc,
RParenLoc);
}
\ No newline at end of file
Modified: cfe/trunk/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/Sema.h?rev=43051&r1=43050&r2=43051&view=diff
==============================================================================
--- cfe/trunk/Sema/Sema.h (original)
+++ cfe/trunk/Sema/Sema.h Tue Oct 16 18:21:02 2007
@@ -448,6 +448,7 @@
// ParseObjCSelectorExpression - Build selector expression for @selector
virtual ExprResult ParseObjCSelectorExpression(Selector Sel,
SourceLocation AtLoc,
+ SourceLocation SelLoc,
SourceLocation LParenLoc,
SourceLocation RParenLoc);
Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=43051&r1=43050&r2=43051&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Tue Oct 16 18:21:02 2007
@@ -1922,6 +1922,7 @@
Sema::ExprResult Sema::ParseObjCSelectorExpression(Selector Sel,
SourceLocation AtLoc,
+ SourceLocation SelLoc,
SourceLocation LParenLoc,
SourceLocation RParenLoc) {
QualType t = GetObjcSelType(AtLoc);
Modified: cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=43051&r1=43050&r2=43051&view=diff
==============================================================================
--- cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/trunk/clang.xcodeproj/project.pbxproj Tue Oct 16 18:21:02 2007
@@ -742,6 +742,7 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
+ compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
projectDirPath = "";
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=43051&r1=43050&r2=43051&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Tue Oct 16 18:21:02 2007
@@ -1099,21 +1099,23 @@
Selector SelName;
- SourceLocation SelLoc, RParenLoc;
+ SourceLocation AtLoc, RParenLoc;
public:
ObjCSelectorExpr(QualType T, Selector selInfo,
- SourceLocation selLoc, SourceLocation rp)
+ SourceLocation at, SourceLocation rp)
: Expr(ObjCSelectorExprClass, T), SelName(selInfo),
- SelLoc(selLoc), RParenLoc(rp) {}
+ AtLoc(at), RParenLoc(rp) {}
const Selector &getSelector() const { return SelName; }
Selector &getSelector() { return SelName; }
+ SourceLocation getAtLoc() const { return AtLoc; }
+ SourceLocation getRParenLoc() const { return RParenLoc; }
+ SourceRange getSourceRange() const { return SourceRange(AtLoc, RParenLoc); }
+
/// getNumArgs - Return the number of actual arguments to this call.
unsigned getNumArgs() const { return SelName.getNumArgs(); }
- SourceRange getSourceRange() const { return SourceRange(SelLoc, RParenLoc); }
-
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCSelectorExprClass;
}
Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=43051&r1=43050&r2=43051&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Tue Oct 16 18:21:02 2007
@@ -596,6 +596,7 @@
}
virtual ExprResult ParseObjCSelectorExpression(Selector Sel,
+ SourceLocation AtLoc,
SourceLocation SelLoc,
SourceLocation LParenLoc,
SourceLocation RParenLoc) {
Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=43051&r1=43050&r2=43051&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Tue Oct 16 18:21:02 2007
@@ -363,8 +363,8 @@
ExprResult ParseObjCAtExpression(SourceLocation AtLocation);
ExprResult ParseObjCStringLiteral();
ExprResult ParseObjCEncodeExpression(SourceLocation AtLoc);
- ExprResult ParseObjCSelectorExpression();
- ExprResult ParseObjCProtocolExpression();
+ ExprResult ParseObjCSelectorExpression(SourceLocation AtLoc);
+ ExprResult ParseObjCProtocolExpression(SourceLocation AtLoc);
ExprResult ParseObjCMessageExpression();
//===--------------------------------------------------------------------===//
More information about the cfe-commits
mailing list