diff options
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/Parse/Parser.h')
-rw-r--r-- | contrib/llvm-project/clang/include/clang/Parse/Parser.h | 70 |
1 files changed, 51 insertions, 19 deletions
diff --git a/contrib/llvm-project/clang/include/clang/Parse/Parser.h b/contrib/llvm-project/clang/include/clang/Parse/Parser.h index e809d87b59a0..02aab3b43be0 100644 --- a/contrib/llvm-project/clang/include/clang/Parse/Parser.h +++ b/contrib/llvm-project/clang/include/clang/Parse/Parser.h @@ -48,7 +48,6 @@ namespace clang { class PoisonSEHIdentifiersRAIIObject; class OMPClause; class ObjCTypeParamList; - class ObjCTypeParameter; struct OMPTraitProperty; struct OMPTraitSelector; struct OMPTraitSet; @@ -202,7 +201,8 @@ class Parser : public CodeCompletionHandler { std::unique_ptr<PragmaHandler> UnrollAndJamHintHandler; std::unique_ptr<PragmaHandler> NoUnrollAndJamHintHandler; std::unique_ptr<PragmaHandler> FPHandler; - std::unique_ptr<PragmaHandler> STDCFENVHandler; + std::unique_ptr<PragmaHandler> STDCFenvAccessHandler; + std::unique_ptr<PragmaHandler> STDCFenvRoundHandler; std::unique_ptr<PragmaHandler> STDCCXLIMITHandler; std::unique_ptr<PragmaHandler> STDCUnknownHandler; std::unique_ptr<PragmaHandler> AttributePragmaHandler; @@ -701,10 +701,6 @@ private: /// #pragma ms_struct... void HandlePragmaMSStruct(); - /// Handle the annotation token produced for - /// #pragma comment... - void HandlePragmaMSComment(); - void HandlePragmaMSPointersToMembers(); void HandlePragmaMSVtorDisp(); @@ -746,6 +742,10 @@ private: void HandlePragmaFEnvAccess(); /// Handle the annotation token produced for + /// #pragma STDC FENV_ROUND... + void HandlePragmaFEnvRound(); + + /// Handle the annotation token produced for /// #pragma float_control void HandlePragmaFloatControl(); @@ -1045,6 +1045,25 @@ private: /// was successful. bool expectIdentifier(); + /// Kinds of compound pseudo-tokens formed by a sequence of two real tokens. + enum class CompoundToken { + /// A '(' '{' beginning a statement-expression. + StmtExprBegin, + /// A '}' ')' ending a statement-expression. + StmtExprEnd, + /// A '[' '[' beginning a C++11 or C2x attribute. + AttrBegin, + /// A ']' ']' ending a C++11 or C2x attribute. + AttrEnd, + /// A '::' '*' forming a C++ pointer-to-member declaration. + MemberPtr, + }; + + /// Check that a compound operator was written in a "sensible" way, and warn + /// if not. + void checkCompoundToken(SourceLocation FirstTokLoc, + tok::TokenKind FirstTokKind, CompoundToken Op); + public: //===--------------------------------------------------------------------===// // Scope manipulation @@ -1343,7 +1362,7 @@ private: void ParseLexedMethodDeclarations() override; - Parser* Self; + Parser *Self; /// Method - The method declaration. Decl *Method; @@ -1710,7 +1729,6 @@ private: ParsedType ParseObjCTypeName(ObjCDeclSpec &DS, DeclaratorContext Ctx, ParsedAttributes *ParamAttrs); - void ParseObjCMethodRequirement(); Decl *ParseObjCMethodPrototype( tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword, bool MethodDefinition = true); @@ -1800,14 +1818,12 @@ private: ExprResult ParsePostfixExpressionSuffix(ExprResult LHS); ExprResult ParseUnaryExprOrTypeTraitExpression(); ExprResult ParseBuiltinPrimaryExpression(); - ExprResult ParseUniqueStableNameExpression(); ExprResult ParseExprAfterUnaryExprOrTypeTrait(const Token &OpTok, bool &isCastExpr, ParsedType &CastTy, SourceRange &CastRange); - typedef SmallVector<Expr*, 20> ExprListTy; typedef SmallVector<SourceLocation, 20> CommaLocsTy; /// ParseExpressionList - Used for C/C++ (argument-)expression-list. @@ -2556,12 +2572,11 @@ private: bool TrySkipAttributes(); public: - TypeResult ParseTypeName(SourceRange *Range = nullptr, - DeclaratorContext Context - = DeclaratorContext::TypeNameContext, - AccessSpecifier AS = AS_none, - Decl **OwnedType = nullptr, - ParsedAttributes *Attrs = nullptr); + TypeResult + ParseTypeName(SourceRange *Range = nullptr, + DeclaratorContext Context = DeclaratorContext::TypeName, + AccessSpecifier AS = AS_none, Decl **OwnedType = nullptr, + ParsedAttributes *Attrs = nullptr); private: void ParseBlockId(SourceLocation CaretLoc); @@ -2780,6 +2795,14 @@ private: SourceLocation ScopeLoc, ParsedAttr::Syntax Syntax); + void ParseSwiftNewTypeAttribute(IdentifierInfo &AttrName, + SourceLocation AttrNameLoc, + ParsedAttributes &Attrs, + SourceLocation *EndLoc, + IdentifierInfo *ScopeName, + SourceLocation ScopeLoc, + ParsedAttr::Syntax Syntax); + void ParseTypeTagForDatatypeAttribute(IdentifierInfo &AttrName, SourceLocation AttrNameLoc, ParsedAttributes &Attrs, @@ -3074,12 +3097,20 @@ private: /// Parse a `match` clause for an '#pragma omp declare variant'. Return true /// if there was an error. - bool parseOMPDeclareVariantMatchClause(SourceLocation Loc, OMPTraitInfo &TI); + bool parseOMPDeclareVariantMatchClause(SourceLocation Loc, OMPTraitInfo &TI, + OMPTraitInfo *ParentTI); /// Parse clauses for '#pragma omp declare variant'. void ParseOMPDeclareVariantClauses(DeclGroupPtrTy Ptr, CachedTokens &Toks, SourceLocation Loc); + /// Parse 'omp [begin] assume[s]' directive. + void ParseOpenMPAssumesDirective(OpenMPDirectiveKind DKind, + SourceLocation Loc); + + /// Parse 'omp end assumes' directive. + void ParseOpenMPEndAssumesDirective(SourceLocation Loc); + /// Parse clauses for '#pragma omp declare target'. DeclGroupPtrTy ParseOMPDeclareTargetClauses(); /// Parse '#pragma omp end declare target'. @@ -3221,6 +3252,9 @@ public: MapTypeModifiers; SmallVector<SourceLocation, NumberOfOMPMapClauseModifiers> MapTypeModifiersLoc; + SmallVector<OpenMPMotionModifierKind, NumberOfOMPMotionModifiers> + MotionModifiers; + SmallVector<SourceLocation, NumberOfOMPMotionModifiers> MotionModifiersLoc; bool IsMapTypeImplicit = false; SourceLocation ExtraModifierLoc; }; @@ -3272,8 +3306,6 @@ private: NamedDecl *ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position); bool isTypeConstraintAnnotation(); bool TryAnnotateTypeConstraint(); - NamedDecl * - ParseConstrainedTemplateTypeParameter(unsigned Depth, unsigned Position); void DiagnoseMisplacedEllipsis(SourceLocation EllipsisLoc, SourceLocation CorrectLoc, bool AlreadyHasEllipsis, |