clang  6.0.0svn
Macros | Functions
ParseExprCXX.cpp File Reference
#include "clang/Parse/Parser.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclTemplate.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 "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 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 tryConsumeMutableOrConstexprToken (Parser &P, SourceLocation &MutableLoc, SourceLocation &ConstexprLoc, SourceLocation &DeclEndLoc)
 
static void addConstexprToLambdaDeclSpecifier (Parser &P, SourceLocation ConstexprLoc, 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

◆ 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,
 
)    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

◆ addConstexprToLambdaDeclSpecifier()

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

Definition at line 1062 of file ParseExprCXX.cpp.

References clang::Sema::ActOnCXXNamedCast(), clang::Sema::ActOnCXXTypeid(), clang::Sema::ActOnCXXUuidof(), clang::Sema::ActOnLambdaError(), clang::Sema::ActOnLambdaExpr(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Declarator::AddTypeInfo(), clang::Scope::BlockScope, clang::Scope::CompoundStmtScope, clang::BalancedDelimiterTracker::consumeClose(), clang::BalancedDelimiterTracker::consumeOpen(), clang::Parser::ConsumeToken(), clang::FixItHint::CreateInsertion(), 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::Sema::getCurGenericLambda(), clang::Parser::getCurScope(), clang::SourceRange::getEnd(), clang::DeclaratorChunk::getFunction(), clang::Token::getIdentifierInfo(), clang::Token::getKind(), clang::Parser::getLangOpts(), clang::Token::getLength(), clang::ParsedAttributes::getList(), clang::Token::getLocation(), clang::AttributeList::getNext(), 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::Declarator::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::T, tryConsumeMutableOrConstexprToken(), clang::TST_error, clang::Declarator::TypeNameContext, and clang::Sema::Unevaluated.

◆ ArrayTypeTraitFromTokKind()

static ArrayTypeTrait ArrayTypeTraitFromTokKind ( tok::TokenKind  kind)
static

Definition at line 2933 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 2941 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

◆ SelectDigraphErrorMessage()

static int SelectDigraphErrorMessage ( tok::TokenKind  Kind)
static

◆ tryConsumeMutableOrConstexprToken()

static void tryConsumeMutableOrConstexprToken ( Parser P,
SourceLocation MutableLoc,
SourceLocation ConstexprLoc,
SourceLocation DeclEndLoc 
)
static

◆ TypeTraitArity()

static unsigned TypeTraitArity ( tok::TokenKind  kind)
static

Definition at line 2949 of file ParseExprCXX.cpp.

References clang::Sema::ActOnArrayTypeTrait(), 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::frontend::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::T, clang::Parser::TryConsumeToken(), clang::Declarator::TypeNameContext, and TypeTraitFromTokKind().

◆ TypeTraitFromTokKind()

static TypeTrait TypeTraitFromTokKind ( tok::TokenKind  kind)
static

Definition at line 2919 of file ParseExprCXX.cpp.

Referenced by TypeTraitArity().