]> granicus.if.org Git - clang/commitdiff
Pass the location of the type.
authorChris Lattner <sabre@nondot.org>
Thu, 30 Aug 2007 17:08:45 +0000 (17:08 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 30 Aug 2007 17:08:45 +0000 (17:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41612 91177308-0d34-0410-b5e6-96231b3b80d8

Parse/ParseExpr.cpp
include/clang/Parse/Action.h

index ff2af565fa14bb34ba33a99e7ac2eb6efece7b6d..cade7a6214a8d66b489e34a6f05b9a788116cb06 100644 (file)
@@ -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 {
index 1f84e0d86f13c3f8e3f492fad5f9e4ffbc78cbfb..cb1acf5afac81ac7b8d489d6ca7ad183c322c736 100644 (file)
@@ -387,7 +387,7 @@ public:
   };
   
   virtual ExprResult ParseBuiltinOffsetOf(SourceLocation BuiltinLoc,
-                                          TypeTy *Arg1,
+                                          SourceLocation TypeLoc, TypeTy *Arg1,
                                           OffsetOfComponent *CompPtr,
                                           unsigned NumComponents,
                                           SourceLocation RParenLoc) {