clang 10.0.0git

Macros | Functions
ParseExprCXX.cpp File Reference
`#include "clang/Parse/Parser.h"`
`#include "clang/AST/ASTContext.h"`
`#include "clang/AST/Decl.h"`
`#include "clang/AST/DeclTemplate.h"`
`#include "clang/AST/ExprCXX.h"`
`#include "clang/Basic/PrettyStackTrace.h"`
`#include "clang/Lex/LiteralSupport.h"`
`#include "clang/Parse/ParseDiagnostic.h"`
`#include "clang/Parse/RAIIObjectsForParser.h"`
`#include "clang/Sema/DeclSpec.h"`
`#include "clang/Sema/ParsedTemplate.h"`
`#include "clang/Sema/Scope.h"`
`#include "llvm/Support/ErrorHandling.h"`
`#include <numeric>`
`#include "clang/Basic/OpenCLImageTypes.def"`
`#include "clang/Basic/OperatorKinds.def"`
`#include "clang/Basic/TokenKinds.def"`
Include dependency graph for ParseExprCXX.cpp:

Go to the source code of this file.

## Macros
#define | GENERIC_IMAGE_TYPE(ImgType, Id)
#define | OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly)
#define | OVERLOADED_OPERATOR_MULTI(Name, Spelling, Unary, Binary, MemberOnly)
#define | TYPE_TRAIT_1(Spelling, Name, Key) case tok::kw_ ## Spelling: return UTT_ ## Name;
#define | TYPE_TRAIT_2(Spelling, Name, Key) case tok::kw_ ## Spelling: return BTT_ ## Name;
#define | TYPE_TRAIT_N(Spelling, Name, Key) case tok::kw_ ## Spelling: return TT_ ## Name;
#define | TYPE_TRAIT(N, Spelling, K) case tok::kw_##Spelling: return N;

## Functions
static int | SelectDigraphErrorMessage (tok::TokenKind Kind)
static void | FixDigraph (Parser &P, Preprocessor &PP, Token &DigraphToken, Token &ColonToken, tok::TokenKind Kind, bool AtDigraph)
static void | tryConsumeLambdaSpecifierToken (Parser &P, SourceLocation &MutableLoc, SourceLocation &ConstexprLoc, SourceLocation &ConstevalLoc, SourceLocation &DeclEndLoc)
static void | addConstexprToLambdaDeclSpecifier (Parser &P, SourceLocation ConstexprLoc, DeclSpec &DS)
static void | addConstevalToLambdaDeclSpecifier (Parser &P, SourceLocation ConstevalLoc, DeclSpec &DS)
static TypeTrait | TypeTraitFromTokKind (tok::TokenKind kind)
static ArrayTypeTrait | ArrayTypeTraitFromTokKind (tok::TokenKind kind)
static ExpressionTrait | ExpressionTraitFromTokKind (tok::TokenKind kind)
static unsigned | TypeTraitArity (tok::TokenKind kind)

## Macro Definition Documentation

## ◆ GENERIC_IMAGE_TYPE

#define GENERIC_IMAGE_TYPE | ( |  | ImgType,
|  |  | Id
| ) |  |

Value:
case tok::kw_##ImgType##_t: \
DS.SetTypeSpecType(DeclSpec::TST_##ImgType##_t, Loc, PrevSpec, DiagID, \
Policy); \
break;

## ◆ OVERLOADED_OPERATOR

#define OVERLOADED_OPERATOR | ( |  | Name,
|  |  | Spelling,
|  |  | Token,
|  |  | Unary,
|  |  | Binary,
|  |  | MemberOnly
| ) |  |

Value:
case tok::Token: \
SymbolLocations[SymbolIdx++] = ConsumeToken(); \
Op = OO_##Name; \
break;

## ◆ OVERLOADED_OPERATOR_MULTI

#define OVERLOADED_OPERATOR_MULTI | ( |  | Name,
|  |  | Spelling,
|  |  | Unary,
|  |  | Binary,
|  |  | MemberOnly
| ) |  |

## ◆ TYPE_TRAIT

#define TYPE_TRAIT | ( |  | N,
|  |  | Spelling,
|  |  | K
| ) |  | case tok::kw_##Spelling: return N;

## ◆ TYPE_TRAIT_1

#define TYPE_TRAIT_1 | ( |  | Spelling,
|  |  | Name,
|  |  | Key
| ) |  | case tok::kw_ ## Spelling: return UTT_ ## Name;

## ◆ TYPE_TRAIT_2

#define TYPE_TRAIT_2 | ( |  | Spelling,
|  |  | Name,
|  |  | Key
| ) |  | case tok::kw_ ## Spelling: return BTT_ ## Name;

## ◆ TYPE_TRAIT_N

#define TYPE_TRAIT_N | ( |  | Spelling,
|  |  | Name,
|  |  | Key
| ) |  | case tok::kw_ ## Spelling: return TT_ ## Name;

## Function Documentation

## ◆ addConstevalToLambdaDeclSpecifier()

static void addConstevalToLambdaDeclSpecifier | ( | Parser & | P,
|  | SourceLocation | ConstevalLoc,
|  | DeclSpec & | DS
| ) |  |
| static

Definition at line 1204 of file ParseExprCXX.cpp.

References clang::Sema::ActOnCXXNamedCast(), clang::Sema::ActOnCXXTypeid(), clang::Sema::ActOnCXXUuidof(), clang::Sema::ActOnLambdaError(), clang::Sema::ActOnLambdaExplicitTemplateParameterList(), clang::Sema::ActOnLambdaExpr(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnStartOfLambdaDefinition(), addConstexprToLambdaDeclSpecifier(), clang::Declarator::AddTypeInfo(), clang::Scope::BlockScope, clang::Scope::CompoundStmtScope, clang::BalancedDelimiterTracker::consumeClose(), clang::BalancedDelimiterTracker::consumeOpen(), clang::Parser::ConsumeToken(), clang::CPlusPlus2a, clang::FixItHint::CreateInsertion(), clang::CSK_consteval, clang::CUDA, clang::Scope::DeclScope, clang::Parser::Diag(), clang::EST_None, clang::BalancedDelimiterTracker::expectAndConsume(), clang::ExprError(), FixDigraph(), clang::Scope::FnScope, clang::Scope::FunctionDeclarationScope, clang::Scope::FunctionPrototypeScope, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Token::getAnnotationValue(), clang::SourceRange::getBegin(), clang::BalancedDelimiterTracker::getCloseLocation(), clang::Declarator::getContext(), clang::Sema::getCurGenericLambda(), clang::Parser::getCurScope(), clang::SourceRange::getEnd(), clang::DeclaratorChunk::getFunction(), clang::Token::getIdentifierInfo(), clang::Token::getKind(), clang::Parser::getLangOpts(), clang::Token::getLength(), clang::Token::getLocation(), clang::BalancedDelimiterTracker::getOpenLocation(), clang::Preprocessor::getSourceManager(), clang::DeclSpec::getTypeSpecType(), clang::Token::is(), clang::CXXScopeSpec::isEmpty(), clang::SourceLocation::isInvalid(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Declarator::isInvalidType(), clang::Token::isNot(), clang::Token::isOneOf(), clang::ActionResult< PtrTy, CompressInvalid >::isUsable(), clang::SourceLocation::isValid(), clang::UnqualifiedId::isValid(), clang::LambdaExprContext, clang::Parser::NextToken(), clang::None, clang::Parser::ParseExpression(), clang::Parser::ParseTypeName(), clang::Sema::PushLambdaScope(), clang::LambdaIntroducer::Range, clang::Sema::RecordParsingTemplateParameterDepth(), clang::Result, clang::Sema::ReuseLambdaContextDecl, clang::DeclSpec::SetConstexprSpec(), clang::UnqualifiedId::setIdentifier(), clang::UnqualifiedId::setTemplateId(), clang::Parser::SkipUntil(), clang::Parser::StopAtSemi, clang::Scope::TemplateParamScope, tryConsumeLambdaSpecifierToken(), clang::TST_error, clang::TypeNameContext, and clang::Sema::Unevaluated.

## ◆ addConstexprToLambdaDeclSpecifier()

static void addConstexprToLambdaDeclSpecifier | ( | Parser & | P,
|  | SourceLocation | ConstexprLoc,
|  | DeclSpec & | DS
| ) |  |
| static

Definition at line 1190 of file ParseExprCXX.cpp.

References clang::CSK_constexpr, clang::Parser::Diag(), clang::Parser::getLangOpts(), clang::SourceLocation::isValid(), and clang::DeclSpec::SetConstexprSpec().

Referenced by addConstevalToLambdaDeclSpecifier().

## ◆ ArrayTypeTraitFromTokKind()

static ArrayTypeTrait ArrayTypeTraitFromTokKind | ( | tok::TokenKind | kind | ) |
| static

Definition at line 3578 of file ParseExprCXX.cpp.

References clang::ATT_ArrayExtent, and clang::ATT_ArrayRank.

Referenced by TypeTraitArity().

## ◆ ExpressionTraitFromTokKind()

static ExpressionTrait ExpressionTraitFromTokKind | ( | tok::TokenKind | kind | ) |
| static

Definition at line 3586 of file ParseExprCXX.cpp.

References clang::ET_IsLValueExpr, and clang::ET_IsRValueExpr.

Referenced by TypeTraitArity().

## ◆ FixDigraph()

static void FixDigraph | ( | Parser & | P,
|  | Preprocessor & | PP,
|  | Token & | DigraphToken,
|  | Token & | ColonToken,
|  | tok::TokenKind | Kind,
|  | bool | AtDigraph
| ) |  |
| static

Definition at line 52 of file ParseExprCXX.cpp.

References clang::FixItHint::CreateReplacement(), clang::Parser::Diag(), clang::Preprocessor::EnterToken(), clang::Token::getLocation(), clang::SourceLocation::getLocWithOffset(), clang::Preprocessor::Lex(), SelectDigraphErrorMessage(), clang::SourceRange::setBegin(), clang::SourceRange::setEnd(), clang::Token::setKind(), clang::Token::setLength(), and clang::Token::setLocation().

Referenced by addConstevalToLambdaDeclSpecifier().

## ◆ SelectDigraphErrorMessage()

static int SelectDigraphErrorMessage | ( | tok::TokenKind | Kind | ) |
| static

Definition at line 29 of file ParseExprCXX.cpp.

References clang::First, clang::Token::getLength(), clang::Token::getLocation(), clang::SourceLocation::getLocWithOffset(), clang::Preprocessor::getSourceManager(), clang::SourceManager::getSpellingLoc(), and SM.

Referenced by FixDigraph().

## ◆ tryConsumeLambdaSpecifierToken()

static void tryConsumeLambdaSpecifierToken | ( | Parser & | P,
|  | SourceLocation & | MutableLoc,
|  | SourceLocation & | ConstexprLoc,
|  | SourceLocation & | ConstevalLoc,
|  | SourceLocation & | DeclEndLoc
| ) |  |
| static

Definition at line 1142 of file ParseExprCXX.cpp.

References clang::Parser::ConsumeToken(), clang::FixItHint::CreateRemoval(), clang::Parser::Diag(), clang::Parser::getCurToken(), clang::Token::getKind(), clang::Token::getLocation(), clang::SourceLocation::isInvalid(), and clang::SourceLocation::isValid().

Referenced by addConstevalToLambdaDeclSpecifier().

## ◆ TypeTraitArity()

static unsigned TypeTraitArity | ( | tok::TokenKind | kind | ) |
| static

Definition at line 3594 of file ParseExprCXX.cpp.

References clang::Sema::ActOnArrayTypeTrait(), clang::Sema::ActOnBuiltinBitCastExpr(), clang::Sema::ActOnCastExpr(), clang::Sema::ActOnExpressionTrait(), clang::Sema::ActOnPackExpansion(), clang::Sema::ActOnParenExpr(), clang::Sema::ActOnTypeName(), clang::Sema::ActOnTypeTrait(), ArrayTypeTraitFromTokKind(), clang::ATT_ArrayExtent, clang::ATT_ArrayRank, clang::Parser::ConsumeAnyToken(), clang::BalancedDelimiterTracker::consumeClose(), clang::Parser::ConsumeToken(), clang::CPlusPlus, clang::Parser::Diag(), clang::comments::tok::eof, clang::BalancedDelimiterTracker::expectAndConsume(), clang::ExprError(), ExpressionTraitFromTokKind(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::BalancedDelimiterTracker::getCloseLocation(), clang::Parser::getCurScope(), clang::Token::getEofData(), clang::Token::getKind(), clang::Parser::getLangOpts(), clang::Token::getLocation(), clang::BalancedDelimiterTracker::getOpenLocation(), clang::Token::is(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Declarator::isInvalidType(), clang::Token::isNot(), clang::Parser::IsTypeCast, clang::Parser::NextToken(), clang::Parser::ParseExpression(), clang::Parser::ParseTypeName(), clang::ColonProtectionRAIIObject::restore(), clang::Result, clang::Token::setEofData(), clang::Token::setKind(), clang::Token::setLocation(), clang::BalancedDelimiterTracker::skipToEnd(), clang::Parser::SkipUntil(), clang::Token::startToken(), clang::Parser::StopAtSemi, clang::Parser::TryConsumeToken(), clang::TypeNameContext, and TypeTraitFromTokKind().

## ◆ TypeTraitFromTokKind()

static TypeTrait TypeTraitFromTokKind | ( | tok::TokenKind | kind | ) |
| static

Definition at line 3564 of file ParseExprCXX.cpp.

Referenced by TypeTraitArity().