clang 22.0.0git
ParseExpr.cpp File Reference

Provides the Expression parsing implementation. More...

#include "clang/AST/ASTContext.h"
#include "clang/AST/Availability.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/LocInfoType.h"
#include "clang/Basic/PrettyStackTrace.h"
#include "clang/Lex/LiteralSupport.h"
#include "clang/Parse/Parser.h"
#include "clang/Parse/RAIIObjectsForParser.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/EnterExpressionEvaluationContext.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/SemaCUDA.h"
#include "clang/Sema/SemaCodeCompletion.h"
#include "clang/Sema/SemaObjC.h"
#include "clang/Sema/SemaOpenACC.h"
#include "clang/Sema/SemaOpenMP.h"
#include "clang/Sema/SemaSYCL.h"
#include "clang/Sema/TypoCorrection.h"
#include "llvm/ADT/SmallVector.h"
#include <optional>
#include "clang/Basic/TransformTypeTraits.def"
#include "clang/Basic/OpenCLImageTypes.def"
#include "clang/Basic/HLSLIntangibleTypes.def"
#include "clang/Basic/TokenKinds.def"

Go to the source code of this file.

Macros

#define RTT_JOIN(X, Y)
#define REVERTIBLE_TYPE_TRAIT(Name)
#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait)
#define GENERIC_IMAGE_TYPE(ImgType, Id)
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)
#define TYPE_TRAIT(N, Spelling, K)
#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait)

Functions

static bool CheckAvailabilitySpecList (Parser &P, ArrayRef< AvailabilitySpec > AvailSpecs)
 Validate availability spec list, emitting diagnostics if necessary.

Detailed Description

Provides the Expression parsing implementation.

Expressions in C99 basically consist of a bunch of binary operators with unary operators and other random stuff at the leaves.

In the C99 grammar, these unary operators bind tightest and are represented as the 'cast-expression' production. Everything else is either a binary operator (e.g. '/') or a ternary operator ("?:"). The unary leaves are handled by ParseCastExpression, the higher level pieces are handled by ParseBinaryExpression.

Definition in file ParseExpr.cpp.

Macro Definition Documentation

◆ GENERIC_IMAGE_TYPE

#define GENERIC_IMAGE_TYPE ( ImgType,
Id )
Value:
case tok::kw_##ImgType##_t:

◆ HLSL_INTANGIBLE_TYPE

#define HLSL_INTANGIBLE_TYPE ( Name,
Id,
SingletonId )
Value:
case tok::kw_##Name:

◆ REVERTIBLE_TYPE_TRAIT

#define REVERTIBLE_TYPE_TRAIT ( Name)
Value:
RevertibleTypeTraits[PP.getIdentifierInfo(#Name)] = RTT_JOIN(tok::kw_, Name)
#define RTT_JOIN(X, Y)

◆ RTT_JOIN

#define RTT_JOIN ( X,
Y )
Value:
X##Y
#define X(type, name)
Definition Value.h:97

◆ TRANSFORM_TYPE_TRAIT_DEF [1/2]

#define TRANSFORM_TYPE_TRAIT_DEF ( _,
Trait )
Value:
#define REVERTIBLE_TYPE_TRAIT(Name)

◆ TRANSFORM_TYPE_TRAIT_DEF [2/2]

#define TRANSFORM_TYPE_TRAIT_DEF ( _,
Trait )
Value:
case tok::kw___##Trait:

◆ TYPE_TRAIT

#define TYPE_TRAIT ( N,
Spelling,
K )
Value:
case tok::kw_##Spelling:

Function Documentation

◆ CheckAvailabilitySpecList()

bool CheckAvailabilitySpecList ( Parser & P,
ArrayRef< AvailabilitySpec > AvailSpecs )
static

Validate availability spec list, emitting diagnostics if necessary.

Returns true if invalid.

Definition at line 3363 of file ParseExpr.cpp.

References clang::FixItHint::CreateInsertion(), clang::Parser::Diag(), and clang::Valid.