Mercurial > hg > CbC > CbC_llvm
diff tools/clang/lib/Parse/ParseCbC.cpp @ 86:99580de8d21d
Fix compile error to update llvm 3.7
## Change variable types tools/clang/lib/Parse/ParseCbC.cpp
* ExternalSpace::StatementFilterCCC Validator
-> std::unique_ptr<ExternalSpace::StatementFilterCCC> Validator(new ExternalSpace::StatementFilterCCC(Next))
* ExternalSpace::CastExpressionIdValidator Validator
-> std::unique_ptr<ExternalSpace::CastExpressionIdValidator> Validator(new ExternalSpace::CastExpressionIdValidator(false,true))
## Change arguments
* DeclaratorChunk::getFunction arguments:23 -> 25
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 24 Feb 2015 06:05:01 +0900 |
parents | 97a220dc594f |
children | ff9ec87918d4 |
line wrap: on
line diff
--- a/tools/clang/lib/Parse/ParseCbC.cpp Thu Feb 19 15:19:25 2015 +0900 +++ b/tools/clang/lib/Parse/ParseCbC.cpp Tue Feb 24 06:05:01 2015 +0900 @@ -239,8 +239,8 @@ LHSToken.setLocation(Loc); LHSToken.setIdentifierInfo(LHSII); LHSToken.setKind(tok::annot_primary_expr); - ExternalSpace::StatementFilterCCC Validator(Next); - Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, LHSII, Loc, Next, false, SS.isEmpty() ? &Validator : 0); + std::unique_ptr<ExternalSpace::StatementFilterCCC> Validator(new ExternalSpace::StatementFilterCCC(Next)); + Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, LHSII, Loc, Next, false, SS.isEmpty() ? std::move(Validator) : 0); setExprAnnotation(LHSToken, Classification.getExpression()); LHSToken.setAnnotationEndLoc(Loc); PP.AnnotateCachedTokens(LHSToken); @@ -291,7 +291,7 @@ (D.isFunctionDeclaratorAFunctionDeclaration() ? Scope::FunctionDeclarationScope : 0)); bool HasProto = false; SmallVector<DeclaratorChunk::ParamInfo, 16> ParamInfo; - SourceLocation EllipsisLoc, RefQualifierLoc, ConstQualifierLoc, VolatileQualifierLoc; + SourceLocation EllipsisLoc, RefQualifierLoc, ConstQualifierLoc, VolatileQualifierLoc, RestrictQualifierLoc; DeclSpec FPDS(AttrFactory); bool RefQualifierIsLValueRef = true; ExceptionSpecificationType ESpecType = EST_None; @@ -299,6 +299,7 @@ SmallVector<ParsedType, 2> DynamicExceptions; SmallVector<SourceRange, 2> DynamicExceptionRanges; ExprResult NoexceptExpr; + CachedTokens *ExceptionSpecTokens = 0; ParsedAttributes FnAttrs(AttrFactory); TypeResult TrailingReturnType; @@ -315,13 +316,14 @@ ParamInfo.push_back(DeclaratorChunk::ParamInfo(0, Loc, Param, 0)); HasProto = true; - D.AddTypeInfo(DeclaratorChunk::getFunction(HasProto,false,Loc,ParamInfo.data(), - ParamInfo.size(),EllipsisLoc, Loc, FPDS.getTypeQualifiers(), - RefQualifierIsLValueRef,RefQualifierLoc, ConstQualifierLoc, - VolatileQualifierLoc,SourceLocation(),ESpecType, ESpecRange.getBegin(), - DynamicExceptions.data(),DynamicExceptionRanges.data(), + D.AddTypeInfo(DeclaratorChunk::getFunction(HasProto, false, Loc, ParamInfo.data(), + ParamInfo.size(), EllipsisLoc, Loc, FPDS.getTypeQualifiers(), + RefQualifierIsLValueRef, RefQualifierLoc, ConstQualifierLoc, + VolatileQualifierLoc, RefQualifierLoc, SourceLocation(), + ESpecType, ESpecRange.getBegin(), + DynamicExceptions.data(), DynamicExceptionRanges.data(), DynamicExceptions.size(), - NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0,Loc, Loc, D,TrailingReturnType), + NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, ExceptionSpecTokens, Loc, Loc, D, TrailingReturnType), FnAttrs, Loc); PrototypeScope.Exit(); DSp = &FDS; @@ -458,9 +460,9 @@ UnqualifiedId Name; CXXScopeSpec SS; SourceLocation TemplateKWLoc; - ExternalSpace::CastExpressionIdValidator Validator(false,true); + std::unique_ptr<ExternalSpace::CastExpressionIdValidator> Validator(new ExternalSpace::CastExpressionIdValidator(false,true)); Name.setIdentifier(II, Loc); - return Actions.ActOnIdExpression(getCurScope(), SS, TemplateKWLoc, Name, false, IsAddressOfOperand, &Validator); + return Actions.ActOnIdExpression(getCurScope(), SS, TemplateKWLoc, Name, false, IsAddressOfOperand, std::move(Validator)); } /// LookupMemberAndBuildExpr - Look up member name, create ExprResult and return it. @@ -621,7 +623,7 @@ bool IsAmbiguous = false; bool HasProto = true; SmallVector<DeclaratorChunk::ParamInfo, 16> ParamInfo; - SourceLocation EllipsisLoc, RefQualifierLoc, ConstQualifierLoc, VolatileQualifierLoc; + SourceLocation EllipsisLoc, RefQualifierLoc, ConstQualifierLoc, VolatileQualifierLoc, RestrictQualifierLoc; DeclSpec FDS(AttrFactory); bool RefQualifierIsLValueRef = true; ExceptionSpecificationType ESpecType = EST_None; @@ -629,6 +631,7 @@ SmallVector<ParsedType, 2> DynamicExceptions; SmallVector<SourceRange, 2> DynamicExceptionRanges; ExprResult NoexceptExpr; + CachedTokens *ExceptionSpecTokens = 0; ParsedAttributes FnAttrs(AttrFactory); TypeResult TrailingReturnType; ParmVarDecl *Param; @@ -645,9 +648,10 @@ D.AddTypeInfo(DeclaratorChunk::getFunction(HasProto, IsAmbiguous, Loc, ParamInfo.data(), ParamInfo.size(), EllipsisLoc, Loc, FDS.getTypeQualifiers(), RefQualifierIsLValueRef, RefQualifierLoc, ConstQualifierLoc, - VolatileQualifierLoc, SourceLocation(), ESpecType, ESpecRange.getBegin(), + VolatileQualifierLoc, RestrictQualifierLoc, SourceLocation(), + ESpecType, ESpecRange.getBegin(), DynamicExceptions.data(), DynamicExceptionRanges.data(), DynamicExceptions.size(), - NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, + NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, ExceptionSpecTokens, Loc, Loc, D, TrailingReturnType), FnAttrs, Loc); PrototypeScope.Exit(); @@ -754,9 +758,9 @@ SourceLocation Loc = Tok.getLocation(); Token Next,IITok; Next.setKind(Kind); - ExternalSpace::StatementFilterCCC CCCValidator(Next); + std::unique_ptr<ExternalSpace::StatementFilterCCC> CCCValidator(new ExternalSpace::StatementFilterCCC(Next)); CXXScopeSpec SS; - Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, II, Loc, Next, false, &CCCValidator); + Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, II, Loc, Next, false, std::move(CCCValidator)); IITok.startToken(); IITok.setLocation(Loc); IITok.setIdentifierInfo(II); @@ -836,8 +840,8 @@ else if (T == DeclSpec::TST_typename) { Token Next,TypeTok; Next.setKind(tok::identifier); - ExternalSpace::StatementFilterCCC CCCValidator(Next); - Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, Name, Loc, Next, false, &CCCValidator); + std::unique_ptr<ExternalSpace::StatementFilterCCC> CCCValidator(new ExternalSpace::StatementFilterCCC(Next)); + Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, Name, Loc, Next, false, std::move(CCCValidator)); TypeTok.startToken(); TypeTok.setLocation(Loc); TypeTok.setIdentifierInfo(Name);