Mercurial > hg > CbC > CbC_llvm
changeset 213:25ca0248ac32
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 11 Jul 2021 17:05:31 +0900 |
parents | 50b3abffaea6 |
children | 0cf2d4ade63d |
files | clang/lib/Parse/ParseCbC.cpp |
diffstat | 1 files changed, 14 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/clang/lib/Parse/ParseCbC.cpp Fri Jun 11 10:19:35 2021 +0900 +++ b/clang/lib/Parse/ParseCbC.cpp Sun Jul 11 17:05:31 2021 +0900 @@ -328,12 +328,7 @@ LHSToken.setKind(tok::identifier); ExternalSpace::StatementFilterCCC SFCCC(Next); Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, LHSII, Loc, Next, SS.isEmpty() ? &SFCCC : nullptr); - if (Classification.getKind() == Sema::NC_ContextIndependentExpr) { - setExprAnnotation(LHSToken, Classification.getExpression()); - LHSToken.setAnnotationEndLoc(Loc); - PP.AnnotateCachedTokens(LHSToken); - LHS = getExprAnnotation(LHSToken); - } else if (Classification.getKind() == Sema::NC_NonType) { + if (Classification.getKind() == Sema::NC_NonType) { Token Tok; Tok.startToken(); Tok.setKind(tok::annot_non_type); @@ -342,8 +337,11 @@ Tok.setAnnotationEndLoc(Loc); NamedDecl *ND = getNonTypeAnnotation(Tok); LHS = Actions.ActOnNameClassifiedAsNonType(getCurScope(), SS, ND, Loc, Tok); - } else { - assert(0); // may be error + } else { + setExprAnnotation(LHSToken, Classification.getExpression()); + LHSToken.setAnnotationEndLoc(Loc); + PP.AnnotateCachedTokens(LHSToken); + LHS = getExprAnnotation(LHSToken); } if (LHSisMemberAccess) LHS = LookupMemberAndBuildExpr(extraLHSII, LHS.get(), false); @@ -423,9 +421,11 @@ ParamInfo.size(), EllipsisLoc, Loc, RefQualifierIsLValueRef, RefQualifierLoc, /*MutableLoc=*/SourceLocation(), - ESpecType, ESpecRange.getBegin(),0 /* NumExceptions */, - DynamicExceptions, - NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, ExceptionSpecTokens, None, Loc, Loc, D, TrailingReturnType,&FPDS), + ESpecType, ESpecRange.getBegin(), + DynamicExceptions.data(), DynamicExceptionRanges.data(), + DynamicExceptions.size(), + // DynamicExceptions, + NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, ExceptionSpecTokens, None, Loc, Loc, D, TrailingReturnType,Loc, &FPDS), std::move(FnAttrs), Loc); PrototypeScope.Exit(); DSp = &FDS; @@ -450,7 +450,7 @@ /// The origins get Type from Declarator but this function get Type from current function. /// It is useful for CbC to create statements for the continuation with the environments. Decl* Parser::HandleDeclAndChangeDeclType(Declarator &D) { - D.setFunctionDefinitionKind(FDK_Declaration); + D.setFunctionDefinitionKind(FunctionDefinitionKind::Declaration); DeclarationNameInfo NameInfo = Actions.GetNameForDeclarator(D); DeclContext *DC = Actions.CurContext; QualType R = Actions.getCurFunctionDecl()->getReturnType(); // copy a type @@ -550,7 +550,7 @@ InnerScope.Exit(); IfScope.Exit(); StmtResult ElseStmt; - IfRes = Actions.ActOnIfStmt(Loc, false, CondExp.get(), Cond, ThenStmt.get(),Loc, ElseStmt.get()); + IfRes = Actions.ActOnIfStmt(Loc, false, Loc, CondExp.get(), Cond, Loc, ThenStmt.get(),Loc, ElseStmt.get()); return IfRes; } @@ -753,7 +753,7 @@ ESpecType, ESpecRange.getBegin(), DynamicExceptions.data(), DynamicExceptionRanges.data(), DynamicExceptions.size(), NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, ExceptionSpecTokens, None, - Loc, Loc, D, TrailingReturnType, &FDS), std::move(FnAttrs), Loc); + Loc, Loc, D, TrailingReturnType, Loc, &FDS), std::move(FnAttrs), Loc); PrototypeScope.Exit(); Decl *TheDecl;