changeset 184:9b4cb9bbd23d

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 01 Jun 2020 23:41:03 +0900
parents 2ba137afec0f
children 86e770a5ed65
files clang/lib/Parse/ParseCbC.cpp clang/lib/Parse/ParseStmt.cpp
diffstat 2 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/clang/lib/Parse/ParseCbC.cpp	Mon Jun 01 19:08:20 2020 +0900
+++ b/clang/lib/Parse/ParseCbC.cpp	Mon Jun 01 23:41:03 2020 +0900
@@ -296,7 +296,9 @@
   LHSToken.setKind(tok::annot_primary_expr);
   ExternalSpace::StatementFilterCCC Validator(Next);
   Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, LHSII, Loc, Next, SS.isEmpty() ? &Validator : nullptr);
-  setExprAnnotation(LHSToken, Classification.getExpression());
+  if (LHSToken.getKind() != tok::annot_primary_expr) {
+     setExprAnnotation(LHSToken, Classification.getExpression());
+  }
   LHSToken.setAnnotationEndLoc(Loc);
   PP.AnnotateCachedTokens(LHSToken);
   
@@ -993,12 +995,8 @@
   Token TokAfterGoto = Tok;
   Stmtsp = &Stmts;
 
- 
   ParsedStmtContext SubStmtCtx =
      ParsedStmtContext::Compound  |  ParsedStmtContext::InStmtExpr; // unconfident
-
-
-  
   gotoRes = ParseStatementOrDeclaration(Stmts, SubStmtCtx);
 
   if (gotoRes.get() == NULL)
--- a/clang/lib/Parse/ParseStmt.cpp	Mon Jun 01 19:08:20 2020 +0900
+++ b/clang/lib/Parse/ParseStmt.cpp	Mon Jun 01 23:41:03 2020 +0900
@@ -265,7 +265,6 @@
     break;
   case tok::kw_for:                 // C99 6.8.5.3: for-statement
     return ParseForStatement(TrailingElseLoc);
-
   case tok::kw_goto:                // C99 6.8.6.1: goto-statement
 #ifndef noCbC
     {
@@ -273,11 +272,9 @@
       if (!(Next.is(tok::identifier) && PP.LookAhead(1).is(tok::semi)) && // C: 'goto' identifier ';'
           Next.isNot(tok::star)) {                                        // C: 'goto' '*' expression ';'
         SemiError = "goto code segment";
-
         if(Next.is(tok::identifier) && NeedPrototypeDeclaration(Next)){ // Probably, direct continuation. goto csName();
           CreatePrototypeDeclaration();
         }
-
         return ParseCbCGotoStatement(Attrs, Stmts);                              // CbC: goto codesegment statement
       }
     }