From: Chris Lattner Date: Thu, 30 Aug 2007 17:08:45 +0000 (+0000) Subject: Pass the location of the type. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9fddf0afb57a863be04369a268dab33b2a7f76f6;p=clang Pass the location of the type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41612 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Parse/ParseExpr.cpp b/Parse/ParseExpr.cpp index ff2af565fa..cade7a6214 100644 --- a/Parse/ParseExpr.cpp +++ b/Parse/ParseExpr.cpp @@ -776,6 +776,7 @@ Parser::ExprResult Parser::ParseBuiltinPrimaryExpression() { break; case tok::kw___builtin_offsetof: { + SourceLocation TypeLoc = Tok.getLocation(); TypeTy *Ty = ParseTypeName(); if (ExpectAndConsume(tok::comma, diag::err_expected_comma, "",tok::r_paren)) @@ -826,7 +827,7 @@ Parser::ExprResult Parser::ParseBuiltinPrimaryExpression() { Comps.back().LocEnd = MatchRHSPunctuation(tok::r_square, Comps.back().LocStart); } else if (Tok.getKind() == tok::r_paren) { - Res = Actions.ParseBuiltinOffsetOf(StartLoc, Ty, &Comps[0], + Res = Actions.ParseBuiltinOffsetOf(StartLoc, TypeLoc, Ty, &Comps[0], Comps.size(), ConsumeParen()); break; } else { diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 1f84e0d86f..cb1acf5afa 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -387,7 +387,7 @@ public: }; virtual ExprResult ParseBuiltinOffsetOf(SourceLocation BuiltinLoc, - TypeTy *Arg1, + SourceLocation TypeLoc, TypeTy *Arg1, OffsetOfComponent *CompPtr, unsigned NumComponents, SourceLocation RParenLoc) {