clang 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
clang::Stmt Class Reference

Stmt - This represents one statement. More...

#include "clang/AST/Stmt.h"

Inheritance diagram for clang::Stmt:
Inheritance graph
[legend]

Classes

class  ArrayOrMatrixSubscriptExprBitfields
 
class  AttributedStmtBitfields
 
class  BinaryOperatorBitfields
 
class  BreakStmtBitfields
 
class  CallExprBitfields
 
class  CastExprBitfields
 
struct  CastIterator
 Iterator for iterating over Stmt * arrays that contain only T *. More...
 
class  CharacterLiteralBitfields
 
class  CoawaitExprBitfields
 
class  CompoundStmtBitfields
 
class  ConstantExprBitfields
 
class  ContinueStmtBitfields
 
class  CXXBoolLiteralExprBitfields
 
class  CXXConstructExprBitfields
 
class  CXXDefaultArgExprBitfields
 
class  CXXDefaultInitExprBitfields
 
class  CXXDeleteExprBitfields
 
class  CXXDependentScopeMemberExprBitfields
 
class  CXXNewExprBitfields
 
class  CXXNoexceptExprBitfields
 
class  CXXNullPtrLiteralExprBitfields
 
class  CXXOperatorCallExprBitfields
 
class  CXXRewrittenBinaryOperatorBitfields
 
class  CXXScalarValueInitExprBitfields
 
class  CXXThisExprBitfields
 
class  CXXThrowExprBitfields
 
class  CXXUnresolvedConstructExprBitfields
 
class  DeclRefExprBitfields
 
class  DependentScopeDeclRefExprBitfields
 
class  DoStmtBitfields
 
struct  EmptyShell
 A placeholder type used to construct an empty shell of a type, that will be filled in later (e.g., by some de-serialization). More...
 
class  ExprBitfields
 
class  ExprWithCleanupsBitfields
 
class  FloatingLiteralBitfields
 
class  ForStmtBitfields
 
class  GenericSelectionExprBitfields
 
class  GotoStmtBitfields
 
class  IfStmtBitfields
 
class  InitListExprBitfields
 
class  LabelStmtBitfields
 
class  LambdaExprBitfields
 
class  MemberExprBitfields
 
class  NullStmtBitfields
 
class  ObjCIndirectCopyRestoreExprBitfields
 
class  OpaqueValueExprBitfields
 
class  OverloadExprBitfields
 
class  ParenListExprBitfields
 
class  PredefinedExprBitfields
 
class  PseudoObjectExprBitfields
 
class  RequiresExprBitfields
 
class  ReturnStmtBitfields
 
class  SourceLocExprBitfields
 
class  StmtBitfields
 
class  StmtExprBitfields
 
class  StringLiteralBitfields
 
class  SubstNonTypeTemplateParmExprBitfields
 
class  SwitchCaseBitfields
 
class  SwitchStmtBitfields
 
class  TypeTraitExprBitfields
 
class  UnaryExprOrTypeTraitExprBitfields
 
class  UnaryOperatorBitfields
 
class  UnresolvedLookupExprBitfields
 
class  UnresolvedMemberExprBitfields
 
class  WhileStmtBitfields
 

Public Types

enum  StmtClass { NoStmtClass = 0 }
 
enum  Likelihood { LH_Unlikely = -1 , LH_None , LH_Likely }
 The likelihood of a branch being taken. More...
 
using child_iterator = StmtIterator
 Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatements/subexpressions of an AST node.
 
using const_child_iterator = ConstStmtIterator
 
using child_range = llvm::iterator_range< child_iterator >
 
using const_child_range = llvm::iterator_range< const_child_iterator >
 

Public Member Functions

void * operator new (size_t bytes, const ASTContext &C, unsigned alignment=8)
 
void * operator new (size_t bytes, const ASTContext *C, unsigned alignment=8)
 
void * operator new (size_t bytes, void *mem) noexcept
 
void operator delete (void *, const ASTContext &, unsigned) noexcept
 
void operator delete (void *, const ASTContext *, unsigned) noexcept
 
void operator delete (void *, size_t) noexcept
 
void operator delete (void *, void *) noexcept
 
 Stmt ()=delete
 
 Stmt (const Stmt &)=delete
 
 Stmt (Stmt &&)=delete
 
Stmtoperator= (const Stmt &)=delete
 
Stmtoperator= (Stmt &&)=delete
 
 Stmt (StmtClass SC)
 
StmtClass getStmtClass () const
 
const char * getStmtClassName () const
 
SourceRange getSourceRange () const LLVM_READONLY
 SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager.
 
SourceLocation getBeginLoc () const LLVM_READONLY
 
SourceLocation getEndLoc () const LLVM_READONLY
 
void dump () const
 Dumps the specified AST fragment and all subtrees to llvm::errs().
 
void dump (raw_ostream &OS, const ASTContext &Context) const
 
int64_t getID (const ASTContext &Context) const
 
void dumpColor () const
 dumpColor - same as dump(), but forces color highlighting.
 
void dumpPretty (const ASTContext &Context) const
 dumpPretty/printPretty - These two methods do a "pretty print" of the AST back to its original source language syntax.
 
void printPretty (raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
 
void printPrettyControlled (raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
 
void printJson (raw_ostream &Out, PrinterHelper *Helper, const PrintingPolicy &Policy, bool AddQuotes) const
 Pretty-prints in JSON format.
 
void viewAST () const
 viewAST - Visualize an AST rooted at this Stmt* using GraphViz.
 
StmtIgnoreContainers (bool IgnoreCaptured=false)
 Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true.
 
const StmtIgnoreContainers (bool IgnoreCaptured=false) const
 
const StmtstripLabelLikeStatements () const
 Strip off all label-like statements.
 
StmtstripLabelLikeStatements ()
 
child_range children ()
 
const_child_range children () const
 
child_iterator child_begin ()
 
child_iterator child_end ()
 
const_child_iterator child_begin () const
 
const_child_iterator child_end () const
 
void Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical, bool ProfileLambdaExpr=false) const
 Produce a unique representation of the given statement.
 
void ProcessODRHash (llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
 Calculate a unique representation for a statement that is stable across compiler invocations.
 

Static Public Member Functions

static void addStmtClass (const StmtClass s)
 
static void EnableStatistics ()
 
static void PrintStats ()
 
static Likelihood getLikelihood (ArrayRef< const Attr * > Attrs)
 
static Likelihood getLikelihood (const Stmt *S)
 
static const AttrgetLikelihoodAttr (const Stmt *S)
 
static Likelihood getLikelihood (const Stmt *Then, const Stmt *Else)
 
static std::tuple< bool, const Attr *, const Attr * > determineLikelihoodConflict (const Stmt *Then, const Stmt *Else)
 

Protected Types

enum  { NumStmtBits = 8 }
 
enum  { NumExprBits = NumStmtBits + 5 + llvm::BitWidth<ExprDependence> }
 
enum  { NumCallExprBits = 32 }
 
enum  { NumOverloadExprBits = NumExprBits + 1 }
 
template<typename T >
using ConstCastIterator = CastIterator< T, const T *const, const Stmt *const >
 Const iterator for iterating over Stmt * arrays that contain only T *.
 
using ExprIterator = CastIterator< Expr >
 
using ConstExprIterator = ConstCastIterator< Expr >
 

Protected Member Functions

void * operator new (size_t bytes) noexcept
 
void operator delete (void *data) noexcept
 
 Stmt (StmtClass SC, EmptyShell)
 Construct an empty statement.
 

Protected Attributes

union {
   StmtBitfields   StmtBits
 
   NullStmtBitfields   NullStmtBits
 
   CompoundStmtBitfields   CompoundStmtBits
 
   LabelStmtBitfields   LabelStmtBits
 
   AttributedStmtBitfields   AttributedStmtBits
 
   IfStmtBitfields   IfStmtBits
 
   SwitchStmtBitfields   SwitchStmtBits
 
   WhileStmtBitfields   WhileStmtBits
 
   DoStmtBitfields   DoStmtBits
 
   ForStmtBitfields   ForStmtBits
 
   GotoStmtBitfields   GotoStmtBits
 
   ContinueStmtBitfields   ContinueStmtBits
 
   BreakStmtBitfields   BreakStmtBits
 
   ReturnStmtBitfields   ReturnStmtBits
 
   SwitchCaseBitfields   SwitchCaseBits
 
   ExprBitfields   ExprBits
 
   ConstantExprBitfields   ConstantExprBits
 
   PredefinedExprBitfields   PredefinedExprBits
 
   DeclRefExprBitfields   DeclRefExprBits
 
   FloatingLiteralBitfields   FloatingLiteralBits
 
   StringLiteralBitfields   StringLiteralBits
 
   CharacterLiteralBitfields   CharacterLiteralBits
 
   UnaryOperatorBitfields   UnaryOperatorBits
 
   UnaryExprOrTypeTraitExprBitfields   UnaryExprOrTypeTraitExprBits
 
   ArrayOrMatrixSubscriptExprBitfields   ArrayOrMatrixSubscriptExprBits
 
   CallExprBitfields   CallExprBits
 
   MemberExprBitfields   MemberExprBits
 
   CastExprBitfields   CastExprBits
 
   BinaryOperatorBitfields   BinaryOperatorBits
 
   InitListExprBitfields   InitListExprBits
 
   ParenListExprBitfields   ParenListExprBits
 
   GenericSelectionExprBitfields   GenericSelectionExprBits
 
   PseudoObjectExprBitfields   PseudoObjectExprBits
 
   SourceLocExprBitfields   SourceLocExprBits
 
   StmtExprBitfields   StmtExprBits
 
   CXXOperatorCallExprBitfields   CXXOperatorCallExprBits
 
   CXXRewrittenBinaryOperatorBitfields   CXXRewrittenBinaryOperatorBits
 
   CXXBoolLiteralExprBitfields   CXXBoolLiteralExprBits
 
   CXXNullPtrLiteralExprBitfields   CXXNullPtrLiteralExprBits
 
   CXXThisExprBitfields   CXXThisExprBits
 
   CXXThrowExprBitfields   CXXThrowExprBits
 
   CXXDefaultArgExprBitfields   CXXDefaultArgExprBits
 
   CXXDefaultInitExprBitfields   CXXDefaultInitExprBits
 
   CXXScalarValueInitExprBitfields   CXXScalarValueInitExprBits
 
   CXXNewExprBitfields   CXXNewExprBits
 
   CXXDeleteExprBitfields   CXXDeleteExprBits
 
   TypeTraitExprBitfields   TypeTraitExprBits
 
   DependentScopeDeclRefExprBitfields   DependentScopeDeclRefExprBits
 
   CXXConstructExprBitfields   CXXConstructExprBits
 
   ExprWithCleanupsBitfields   ExprWithCleanupsBits
 
   CXXUnresolvedConstructExprBitfields   CXXUnresolvedConstructExprBits
 
   CXXDependentScopeMemberExprBitfields   CXXDependentScopeMemberExprBits
 
   OverloadExprBitfields   OverloadExprBits
 
   UnresolvedLookupExprBitfields   UnresolvedLookupExprBits
 
   UnresolvedMemberExprBitfields   UnresolvedMemberExprBits
 
   CXXNoexceptExprBitfields   CXXNoexceptExprBits
 
   SubstNonTypeTemplateParmExprBitfields   SubstNonTypeTemplateParmExprBits
 
   LambdaExprBitfields   LambdaExprBits
 
   RequiresExprBitfields   RequiresExprBits
 
   CoawaitExprBitfields   CoawaitBits
 
   ObjCIndirectCopyRestoreExprBitfields   ObjCIndirectCopyRestoreExprBits
 
   OpaqueValueExprBitfields   OpaqueValueExprBits
 
}; 
 

Friends

class ASTStmtReader
 
class ASTStmtWriter
 

Detailed Description

Stmt - This represents one statement.

Definition at line 84 of file Stmt.h.

Member Typedef Documentation

◆ child_iterator

Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatements/subexpressions of an AST node.

This permits easy iteration over all nodes in the AST.

Definition at line 1449 of file Stmt.h.

◆ child_range

using clang::Stmt::child_range = llvm::iterator_range<child_iterator>

Definition at line 1452 of file Stmt.h.

◆ const_child_iterator

Definition at line 1450 of file Stmt.h.

◆ const_child_range

Definition at line 1453 of file Stmt.h.

◆ ConstCastIterator

template<typename T >
using clang::Stmt::ConstCastIterator = CastIterator<T, const T *const, const Stmt *const>
protected

Const iterator for iterating over Stmt * arrays that contain only T *.

Definition at line 1334 of file Stmt.h.

◆ ConstExprIterator

Definition at line 1337 of file Stmt.h.

◆ ExprIterator

Definition at line 1336 of file Stmt.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
NumStmtBits 

Definition at line 121 of file Stmt.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumExprBits 

Definition at line 364 of file Stmt.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumCallExprBits 

Definition at line 572 of file Stmt.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumOverloadExprBits 

Definition at line 1062 of file Stmt.h.

◆ Likelihood

The likelihood of a branch being taken.

Enumerator
LH_Unlikely 

Branch has the [[unlikely]] attribute.

LH_None 

No attribute set or branches of the IfStmt have the same attribute.

LH_Likely 

Branch has the [[likely]] attribute.

Definition at line 1306 of file Stmt.h.

◆ StmtClass

Enumerator
NoStmtClass 

Definition at line 86 of file Stmt.h.

Constructor & Destructor Documentation

◆ Stmt() [1/5]

clang::Stmt::Stmt ( StmtClass  SC,
EmptyShell   
)
inlineexplicitprotected

Construct an empty statement.

Definition at line 1345 of file Stmt.h.

◆ Stmt() [2/5]

clang::Stmt::Stmt ( )
delete

◆ Stmt() [3/5]

clang::Stmt::Stmt ( const Stmt )
delete

◆ Stmt() [4/5]

clang::Stmt::Stmt ( Stmt &&  )
delete

◆ Stmt() [5/5]

clang::Stmt::Stmt ( StmtClass  SC)
inline

Definition at line 1354 of file Stmt.h.

References addStmtClass(), and StmtBits.

Member Function Documentation

◆ addStmtClass()

void Stmt::addStmtClass ( const StmtClass  s)
static

Definition at line 126 of file Stmt.cpp.

References StmtClassNameTable::Counter, getStmtInfoTableEntry(), and s.

Referenced by Stmt().

◆ child_begin() [1/2]

child_iterator clang::Stmt::child_begin ( )
inline

◆ child_begin() [2/2]

const_child_iterator clang::Stmt::child_begin ( ) const
inline

Definition at line 1465 of file Stmt.h.

References children().

◆ child_end() [1/2]

child_iterator clang::Stmt::child_end ( )
inline

◆ child_end() [2/2]

const_child_iterator clang::Stmt::child_end ( ) const
inline

Definition at line 1466 of file Stmt.h.

References children().

◆ children() [1/2]

Stmt::child_range Stmt::children ( )

◆ children() [2/2]

const_child_range clang::Stmt::children ( ) const
inline

Definition at line 1457 of file Stmt.h.

References children().

◆ determineLikelihoodConflict()

std::tuple< bool, const Attr *, const Attr * > Stmt::determineLikelihoodConflict ( const Stmt Then,
const Stmt Else 
)
static
Returns
whether the likelihood of the branches of an if statement are conflicting. When the first element is true there's a conflict and the Attr's are the conflicting attributes of the Then and Else Stmt.

Definition at line 185 of file Stmt.cpp.

References getLikelihood(), and LH_None.

Referenced by clang::Sema::ActOnIfStmt().

◆ dump() [1/2]

LLVM_DUMP_METHOD void Stmt::dump ( ) const

Dumps the specified AST fragment and all subtrees to llvm::errs().

Definition at line 289 of file ASTDumper.cpp.

References P.

Referenced by clang::Sema::ActOnPragmaDump(), and clang::FunctionEffectsRef::dump().

◆ dump() [2/2]

LLVM_DUMP_METHOD void Stmt::dump ( raw_ostream &  OS,
const ASTContext Context 
) const

◆ dumpColor()

LLVM_DUMP_METHOD void Stmt::dumpColor ( ) const

dumpColor - same as dump(), but forces color highlighting.

Definition at line 300 of file ASTDumper.cpp.

References P.

◆ dumpPretty()

void Stmt::dumpPretty ( const ASTContext Context) const

dumpPretty/printPretty - These two methods do a "pretty print" of the AST back to its original source language syntax.

Definition at line 2811 of file StmtPrinter.cpp.

References clang::ASTContext::getLangOpts(), and printPretty().

◆ EnableStatistics()

void Stmt::EnableStatistics ( )
static

Definition at line 131 of file Stmt.cpp.

Referenced by clang::ParseAST().

◆ getBeginLoc()

SourceLocation Stmt::getBeginLoc ( ) const

Definition at line 338 of file Stmt.cpp.

References getStmtClass(), and NoStmtClass.

Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), clang::Sema::ActOnArraySubscriptExpr(), clang::SemaOpenACC::ActOnAssociatedStmt(), clang::Sema::ActOnCondition(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnCXXForRangeStmt(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnGCCAsmStmt(), clang::Sema::ActOnIfStmt(), clang::Sema::ActOnMSAsmStmt(), clang::Sema::ActOnNoexceptSpec(), clang::SemaOpenMP::ActOnOpenMPAtomicDirective(), clang::SemaOpenMP::ActOnOpenMPDispatchDirective(), clang::SemaOpenMP::ActOnOpenMPDistScheduleClause(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPMessageClause(), clang::SemaOpenMP::ActOnOpenMPOrderedDirective(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPScheduleClause(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), clang::Sema::ActOnPackIndexingExpr(), clang::Sema::ActOnStmtExprResult(), clang::Sema::AddAllocAlignAttr(), clang::Sema::AddConversionCandidate(), clang::SemaObjC::adornBoolConversionDiagWithTernaryFixit(), AnalyzeAssignment(), AnalyzeBitFieldAssignment(), AnalyzeImplicitConversions(), clang::Sema::BuildArrayType(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCallToMemberFunction(), buildCaptureDecl(), BuildConvertedConstantExpression(), clang::Sema::BuildCXXAssumeExpr(), clang::Sema::BuildCXXDefaultArgExpr(), clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXThrow(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildDeclRefExpr(), clang::SemaObjC::BuildInstanceMessage(), BuildNonArrayForRange(), clang::Sema::BuildPackIndexingExpr(), clang::Sema::BuildPackIndexingType(), clang::Sema::BuildResolvedCallExpr(), clang::Sema::BuildReturnStmt(), clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::BuildVAArgExpr(), BuiltinAnnotation(), BuiltinCountZeroBitsGeneric(), BuiltinDumpStruct(), clang::Sema::BuiltinElementwiseTernaryMath(), BuiltinOverflow(), BuiltinPopcountg(), clang::SemaPPC::BuiltinPPCMMACall(), clang::Sema::BuiltinShuffleVector(), clang::Sema::BuiltinVectorMath(), clang::SemaPPC::BuiltinVSX(), clang::SemaWasm::BuiltinWasmTableCopy(), clang::SemaWasm::BuiltinWasmTableFill(), clang::SemaWasm::BuiltinWasmTableGrow(), calculateConstraintSatisfaction(), clang::Sema::CanPerformCopyInitialization(), castForMoving(), CastForMoving(), clang::Sema::CheckAddressOfOperand(), CheckArgsTypesAreCorrect(), checkArithmeticOrEnumeralThreeWayCompare(), clang::SemaARM::CheckARMCoprocessorImmediate(), clang::Sema::CheckAssignmentConstraints(), clang::Sema::CheckAssignmentOperands(), CheckAtomicAlignment(), clang::SemaBPF::CheckBPFBuiltinFunctionCall(), clang::SemaOpenCL::checkBuiltinEnqueueKernel(), clang::SemaX86::CheckBuiltinFunctionCall(), clang::SemaOpenCL::checkBuiltinKernelWorkGroupSize(), clang::SemaOpenCL::checkBuiltinNDRangeAndBlock(), checkBuiltinVerboseTrap(), clang::Sema::CheckConditionalOperands(), CheckConstexprFunctionBody(), clang::SemaObjC::CheckConversionToObjCLiteral(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), CheckEvalInICE(), checkExprMemoryConstraintCompat(), CheckFallThroughForBody(), CheckFoldOperand(), clang::Sema::CheckFunctionDeclaration(), CheckICE(), clang::SemaObjC::CheckImplementationIvars(), clang::Sema::CheckMemberPointerConversion(), CheckMoveOnConstruction(), CheckNakedParmReference(), clang::SemaARM::CheckNeonBuiltinFunctionCall(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::SemaObjC::CheckObjCBridgeRelatedConversions(), CheckObjCCollectionLiteralElement(), clang::SemaObjC::CheckObjCString(), clang::checkOpenCLEnqueueIntType(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), checkOpenMPLoop(), checkParamIsIntegerType(), clang::checkPipeArg(), clang::Sema::CheckPlaceholderExpr(), clang::Sema::CheckPointerToMemberOperands(), checkRecursiveFunction(), checkSectionsDirective(), clang::Sema::CheckSingleAssignmentConstraints(), CheckStmtInlineAttr(), CheckStringInit(), clang::Sema::checkStringLiteralArgumentAttr(), clang::SemaSystemZ::CheckSystemZBuiltinFunctionCall(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), checkThreeWayNarrowingConversion(), clang::Sema::checkVariadicArgument(), CheckVectorElementCallArgs(), clang::CheckWasmBuiltinArgIsInteger(), clang::CheckWasmBuiltinArgIsTable(), clang::Sema::ConstantFoldAttrArgs(), ConvertForConditional(), clang::Sema::ConvertMemberDefaultInitExpression(), clang::Sema::CorrectDelayedTyposInExpr(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CreateBuiltinMatrixSubscriptExpr(), CreateIfFixit(), clang::Sema::CreateLaunchBoundsAttr(), CreateNewFunctionDecl(), createOverloadsForFixedParams(), clang::Sema::DefaultVariadicArgumentPromotion(), clang::InitializationSequence::Diagnose(), clang::Sema::DiagnoseAlwaysNonNullPointer(), clang::Sema::DiagnoseAssignmentAsCondition(), DiagnoseBitwisePrecedence(), DiagnoseCastQual(), clang::Sema::DiagnoseCommaOperator(), DiagnoseConditionalPrecedence(), clang::Sema::DiagnoseEmptyLoopBody(), clang::Sema::DiagnoseImmediateEscalatingReason(), DiagnoseIndirectOrAsmJumpStmt(), DiagnoseLabelFollowedByDecl(), diagnoseLogicalNotOnLHSofCheck(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), DiagnoseNarrowingInInitList(), diagnoseNoViableConversion(), diagnoseObjCLiteralComparison(), diagnoseRepeatedUseOfWeak(), DiagnoseShiftCompare(), diagnoseStringPlusChar(), diagnoseStringPlusInt(), diagnoseTautologicalComparison(), clang::Sema::DiagnoseUnexpandedParameterPack(), DiagnoseUninitializedConstRefUse(), diagnoseUnsatisfiedRequirement(), diagnoseWellFormedUnsatisfiedConstraintExpr(), clang::Sema::diagnoseZeroToNullptrConversion(), DiagUninitUse(), emitAndFixInvalidAsmCastLValue(), emitOutlinedFunctionPrologue(), clang::Sema::EvaluateConvertedConstantExpression(), evaluateVarDeclInit(), clang::Sema::GatherArgumentsForCall(), getAndVerifyMatrixDimension(), clang::StmtSequence::getBeginLoc(), clang::UserDefinedLiteral::getBeginLoc(), clang::MSPropertyRefExpr::getBeginLoc(), clang::OMPCanonicalLoop::getBeginLoc(), clang::ConstantExpr::getBeginLoc(), clang::OpaqueValueExpr::getBeginLoc(), clang::ImaginaryLiteral::getBeginLoc(), clang::ArraySubscriptExpr::getBeginLoc(), clang::MatrixSubscriptExpr::getBeginLoc(), clang::CallExpr::getBeginLoc(), clang::MemberExpr::getBeginLoc(), clang::ImplicitCastExpr::getBeginLoc(), clang::BinaryOperator::getBeginLoc(), clang::ConditionalOperator::getBeginLoc(), clang::BinaryConditionalOperator::getBeginLoc(), clang::DesignatedInitUpdateExpr::getBeginLoc(), clang::ExtVectorElementExpr::getBeginLoc(), clang::PseudoObjectExpr::getBeginLoc(), clang::ArraySectionExpr::getBeginLoc(), clang::CXXRewrittenBinaryOperator::getBeginLoc(), clang::CXXStdInitializerListExpr::getBeginLoc(), clang::MSPropertySubscriptExpr::getBeginLoc(), clang::CXXBindTemporaryExpr::getBeginLoc(), clang::ExprWithCleanups::getBeginLoc(), clang::PackExpansionExpr::getBeginLoc(), clang::MaterializeTemporaryExpr::getBeginLoc(), clang::CXXFoldExpr::getBeginLoc(), clang::ObjCIvarRefExpr::getBeginLoc(), clang::ObjCPropertyRefExpr::getBeginLoc(), clang::ObjCSubscriptRefExpr::getBeginLoc(), clang::ObjCIsaExpr::getBeginLoc(), clang::CapturedStmt::getBeginLoc(), getExprText(), DerefSimplePtrArithFixableGadget::getFixits(), UUCAddAssignGadget::getFixits(), clang::PackIndexingExpr::getPackLoc(), clang::CXXRewrittenBinaryOperator::getSourceRange(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), handleAlwaysInlineAttr(), handleDiagnoseAsBuiltinAttr(), handleDiagnoseIfAttr(), handleFallThroughAttr(), handleHLSLLoopHintAttr(), handleLoopHintAttr(), handleNoConvergentAttr(), handleNoInlineAttr(), handleNoMergeAttr(), HandleOperatorNewCall(), handlePassObjectSizeAttr(), handlePatchableFunctionEntryAttr(), clang::Sema::ImpCastExprToType(), clang::AnalysisDeclContext::isBodyAutosynthesizedFromModelFile(), IsEnumConstOrFromMacro(), IsInitializerListConstructorConversion(), clang::Sema::IsIntegralPromotion(), clang::Sema::IsMemberPointerConversion(), isNullPointerValueTemplateArgument(), clang::Sema::IsPointerConversion(), clang::Expr::isUnusedResultAWarning(), IsUserDefinedConversion(), IsVectorConversion(), clang::Sema::MarkMemberReferenced(), MatchTemplateParameterKind(), maybeDiagnoseAssignmentToFunction(), clang::Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), clang::Parser::ParseConstraintLogicalAndExpression(), clang::ento::ConditionBRVisitor::patternMatch(), clang::InitializationSequence::Perform(), clang::Sema::PerformContextuallyConvertToBool(), clang::Sema::PerformCopyInitialization(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformImplicitObjectArgumentInitialization(), clang::Sema::PrepareBuiltinElementwiseMathOneArgCall(), clang::ento::ExprEngine::ProcessStmt(), ProcessStmtAttribute(), removePunyEdges(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), rewriteToArrayLiteral(), rewriteToDictionaryLiteral(), clang::CodeGen::CGOpenMPRuntime::scanForTargetRegionsFunctions(), clang::TopLevelStmtDecl::setStmt(), clang::Sema::SubstDefaultArgument(), clang::Sema::TemplateParameterListsAreEqual(), EnsureImmediateInvocationInDefaultArgs::TransformSourceLocExpr(), TryClassUnification(), clang::Sema::tryConvertExprToType(), TryCopyInitialization(), TryImplicitConversion(), TryLValueToRValueCast(), TryOrBuildParenListInitialization(), TryUserDefinedConversion(), clang::Sema::VerifyIntegerConstantExpression(), clang::ASTNodeImporter::VisitArrayTypeTraitExpr(), clang::ASTNodeImporter::VisitCXXDefaultInitExpr(), clang::ASTNodeImporter::VisitCXXDeleteExpr(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::ASTNodeImporter::VisitCXXNoexceptExpr(), clang::ASTNodeImporter::VisitExpr(), clang::ASTNodeImporter::VisitExpressionTraitExpr(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTNodeImporter::VisitGNUNullExpr(), clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode(), clang::ASTNodeImporter::VisitPredefinedExpr(), clang::ASTNodeImporter::VisitShuffleVectorExpr(), clang::ASTNodeImporter::VisitSourceLocExpr(), and clang::ASTNodeImporter::VisitTypeTraitExpr().

◆ getEndLoc()

SourceLocation Stmt::getEndLoc ( ) const

Definition at line 350 of file Stmt.cpp.

References getStmtClass(), and NoStmtClass.

Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), clang::Sema::ActOnCondition(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnLambdaExpr(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), clang::Sema::ActOnParamDefaultArgumentError(), addBlockPointerConversion(), addFunctionPointerConversion(), clang::SemaObjC::adornBoolConversionDiagWithTernaryFixit(), clang::Sema::BuildCStyleCastExpr(), clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildReturnStmt(), BuiltinDumpStruct(), clang::Sema::BuiltinShuffleVector(), clang::SemaPPC::BuiltinVSX(), CheckFallThroughForBody(), CheckFoldOperand(), clang::Sema::CheckLogicalOperands(), clang::SemaObjC::CheckObjCBridgeRelatedConversions(), clang::Sema::CheckPointerToMemberOperands(), CheckVectorElementCallArgs(), clang::Sema::ConvertMemberDefaultInitExpression(), clang::Sema::CorrectDelayedTyposInExpr(), clang::Sema::CreateBuiltinBinOp(), CreateIfFixit(), clang::ento::CXXDestructorCall::CXXDestructorCall(), clang::Sema::DefaultVariadicArgumentPromotion(), clang::Sema::DiagnoseAlwaysNonNullPointer(), DiagnoseBitwisePrecedence(), clang::Sema::DiagnoseCommaOperator(), DiagnoseConditionalPrecedence(), DiagnoseDirectIsaAccess(), diagnoseLogicalNotOnLHSofCheck(), DiagnoseNarrowingInInitList(), diagnoseNoViableConversion(), diagnoseObjCLiteralComparison(), clang::Sema::DiagnoseSentinelCalls(), DiagnoseShiftCompare(), diagnoseStringPlusChar(), diagnoseStringPlusInt(), clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), clang::ObjCIsaExpr::getBaseLocEnd(), clang::StmtSequence::getEndLoc(), clang::ForStmt::getEndLoc(), clang::SEHTryStmt::getEndLoc(), clang::CXXTryStmt::getEndLoc(), clang::OMPCanonicalLoop::getEndLoc(), clang::ConstantExpr::getEndLoc(), clang::OpaqueValueExpr::getEndLoc(), clang::ImaginaryLiteral::getEndLoc(), clang::CallExpr::getEndLoc(), clang::MemberExpr::getEndLoc(), clang::ImplicitCastExpr::getEndLoc(), clang::CStyleCastExpr::getEndLoc(), clang::BinaryOperator::getEndLoc(), clang::ConditionalOperator::getEndLoc(), clang::BinaryConditionalOperator::getEndLoc(), clang::DesignatedInitExpr::getEndLoc(), clang::DesignatedInitUpdateExpr::getEndLoc(), clang::BlockExpr::getEndLoc(), clang::PseudoObjectExpr::getEndLoc(), clang::CXXRewrittenBinaryOperator::getEndLoc(), clang::CXXStdInitializerListExpr::getEndLoc(), clang::CXXThrowExpr::getEndLoc(), clang::CXXBindTemporaryExpr::getEndLoc(), clang::CXXConstructExpr::getEndLoc(), clang::CXXFunctionalCastExpr::getEndLoc(), clang::CXXTemporaryObjectExpr::getEndLoc(), clang::CXXDeleteExpr::getEndLoc(), clang::ExprWithCleanups::getEndLoc(), clang::CXXUnresolvedConstructExpr::getEndLoc(), clang::MaterializeTemporaryExpr::getEndLoc(), clang::CXXFoldExpr::getEndLoc(), clang::CoroutineSuspendExpr::getEndLoc(), clang::DependentCoawaitExpr::getEndLoc(), clang::ObjCStringLiteral::getEndLoc(), clang::ObjCBridgedCastExpr::getEndLoc(), clang::OMPArrayShapingExpr::getEndLoc(), clang::CaseStmt::getEndLoc(), clang::DefaultStmt::getEndLoc(), clang::LabelStmt::getEndLoc(), clang::AttributedStmt::getEndLoc(), clang::IfStmt::getEndLoc(), clang::SwitchStmt::getEndLoc(), clang::WhileStmt::getEndLoc(), clang::ReturnStmt::getEndLoc(), clang::CapturedStmt::getEndLoc(), clang::CXXCatchStmt::getEndLoc(), clang::CXXForRangeStmt::getEndLoc(), clang::MSDependentExistsStmt::getEndLoc(), clang::CoreturnStmt::getEndLoc(), clang::ObjCForCollectionStmt::getEndLoc(), clang::ObjCAtCatchStmt::getEndLoc(), clang::ObjCAtFinallyStmt::getEndLoc(), clang::ObjCAtTryStmt::getEndLoc(), clang::ObjCAtThrowStmt::getEndLoc(), clang::ObjCAutoreleasePoolStmt::getEndLoc(), UUCAddAssignGadget::getFixits(), clang::CXXRewrittenBinaryOperator::getSourceRange(), clang::FieldDecl::getSourceRange(), clang::TopLevelStmtDecl::getSourceRange(), clang::BlockDecl::getSourceRange(), clang::ConceptDecl::getSourceRange(), isNullPointerValueTemplateArgument(), clang::Expr::isUnusedResultAWarning(), clang::Parser::ParseConstraintLogicalAndExpression(), clang::ento::ConditionBRVisitor::patternMatch(), rewriteToArrayLiteral(), rewriteToDictionaryLiteral(), clang::consumed::ConsumedAnalyzer::run(), clang::FunctionDecl::setBody(), clang::Declarator::setTrailingRequiresClause(), EnsureImmediateInvocationInDefaultArgs::TransformSourceLocExpr(), TryOrBuildParenListInitialization(), clang::ASTNodeImporter::VisitArrayTypeTraitExpr(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::ASTNodeImporter::VisitCXXNoexceptExpr(), clang::ASTNodeImporter::VisitExpressionTraitExpr(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTNodeImporter::VisitLambdaExpr(), clang::ASTNodeImporter::VisitSourceLocExpr(), and clang::ASTNodeImporter::VisitTypeTraitExpr().

◆ getID()

int64_t Stmt::getID ( const ASTContext Context) const

◆ getLikelihood() [1/3]

Stmt::Likelihood Stmt::getLikelihood ( ArrayRef< const Attr * >  Attrs)
static
Returns
the likelihood of a set of attributes.

Definition at line 155 of file Stmt.cpp.

Referenced by determineLikelihoodConflict(), and getLikelihood().

◆ getLikelihood() [2/3]

Stmt::Likelihood Stmt::getLikelihood ( const Stmt S)
static
Returns
the likelihood of a statement.

Definition at line 159 of file Stmt.cpp.

◆ getLikelihood() [3/3]

Stmt::Likelihood Stmt::getLikelihood ( const Stmt Then,
const Stmt Else 
)
static
Returns
the likelihood of the 'then' branch of an 'if' statement. The 'else' branch is required to determine whether both branches specify the same likelihood, which affects the result.

Definition at line 167 of file Stmt.cpp.

References getLikelihood(), LH_Likely, LH_None, and LH_Unlikely.

◆ getLikelihoodAttr()

const Attr * Stmt::getLikelihoodAttr ( const Stmt S)
static
Returns
the likelihood attribute of a statement.

Definition at line 163 of file Stmt.cpp.

Referenced by clang::Sema::ActOnIfStmt().

◆ getSourceRange()

SourceRange Stmt::getSourceRange ( ) const

SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager.

We assume AST clients will have a pointer to the respective SourceManager.

Definition at line 326 of file Stmt.cpp.

References getStmtClass(), and NoStmtClass.

Referenced by clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnCastExpr(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnCXXFoldExpr(), clang::Sema::ActOnCXXForRangeStmt(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnDependentMemberExpr(), clang::Sema::ActOnDesignatedInitializer(), clang::Sema::ActOnEffectExpression(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnGCCAsmStmt(), clang::SemaOpenACC::ActOnIntExpr(), clang::Sema::ActOnMSAsmStmt(), clang::SemaObjC::ActOnObjCAtSynchronizedOperand(), clang::SemaOpenMP::ActOnOMPArraySectionExpr(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaOpenMP::ActOnOpenMPAllocateDirective(), clang::SemaOpenMP::ActOnOpenMPAtomicDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDependClause(), clang::SemaOpenMP::ActOnOpenMPDepobjClause(), clang::SemaOpenMP::ActOnOpenMPDetachClause(), clang::SemaOpenMP::ActOnOpenMPDistScheduleClause(), clang::SemaOpenMP::ActOnOpenMPHasDeviceAddrClause(), clang::SemaOpenMP::ActOnOpenMPIsDevicePtrClause(), clang::SemaOpenMP::ActOnOpenMPScheduleClause(), clang::Sema::ActOnParamDefaultArgument(), clang::Sema::ActOnStartLinkageSpecification(), clang::Sema::ActOnStartOfSwitchStmt(), clang::Sema::AddAlignedAttr(), clang::Sema::AddAlignValueAttr(), clang::Sema::AddAssumeAlignedAttr(), addFixitForObjCARCConversion(), clang::interp::AddSubMulHelper(), AnalyzeBitFieldAssignment(), AnalyzeComparison(), AnalyzeImplicitConversions(), applyCocoaAPICheck(), BuildAddressSpaceIndex(), clang::Sema::BuildArrayType(), clang::Sema::BuildAsTypeExpr(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCallToMemberFunction(), buildCoawaitCalls(), clang::Sema::BuildCompoundLiteralExpr(), BuildConvertedConstantExpression(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDeclaratorGroup(), clang::Sema::BuildExtVectorType(), clang::SemaObjC::BuildInstanceMessage(), clang::Sema::BuildMatrixType(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildNestedRequirement(), clang::SemaObjC::BuildObjCAtThrowStmt(), clang::SemaObjC::BuildObjCBoxedExpr(), clang::SemaObjC::BuildObjCBridgedCast(), clang::SemaObjC::BuildObjCNumericLiteral(), clang::Sema::BuildReturnStmt(), clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::BuildVAArgExpr(), clang::Sema::BuildVectorLiteral(), clang::Sema::BuildVectorType(), BuiltinAnnotation(), clang::SemaARM::BuiltinARMMemoryTaggingCall(), clang::SemaARM::BuiltinARMSpecialReg(), BuiltinCallWithStaticChain(), clang::Sema::BuiltinConstantArg(), clang::Sema::BuiltinConstantArgMultiple(), clang::Sema::BuiltinConstantArgPower2(), clang::Sema::BuiltinConstantArgRange(), clang::Sema::BuiltinConstantArgShiftedByte(), clang::Sema::BuiltinConstantArgShiftedByteOrXXFF(), BuiltinCpu(), BuiltinFunctionStart(), BuiltinLaunder(), BuiltinMSVCAnnotation(), BuiltinOverflow(), clang::Sema::BuiltinShuffleVector(), clang::SemaWasm::BuiltinWasmTableCopy(), clang::SemaWasm::BuiltinWasmTableFill(), clang::SemaWasm::BuiltinWasmTableGrow(), calculateConstraintSatisfaction(), clang::interp::CallPtr(), clang::interp::CallVirt(), castForMoving(), CastForMoving(), clang::Sema::CheckAddressOfMemberAccess(), clang::Sema::CheckAddressOfOperand(), CheckAlignOfExpr(), checkAllocateClauses(), clang::SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(), clang::checkAMDGPUMaxNumWorkGroupsArguments(), checkArithmeticBinOpPointerOperands(), checkArithmeticNull(), checkArithmeticOnObjCPointer(), clang::SemaARM::CheckARMBuiltinExclusiveCall(), clang::SemaARM::CheckARMCoprocessorImmediate(), clang::checkArmStreamingBuiltin(), clang::Sema::CheckBooleanCondition(), clang::SemaBPF::CheckBPFBuiltinFunctionCall(), clang::SemaRISCV::CheckBuiltinFunctionCall(), clang::SemaX86::CheckBuiltinGatherScatterScale(), clang::SemaX86::CheckBuiltinRoundingOrSAE(), clang::SemaOpenCL::checkBuiltinRWPipe(), CheckBuiltinTargetInSupported(), CheckBuiltinTargetNotInUnsupported(), clang::SemaX86::CheckBuiltinTileDuplicate(), checkBuiltinVerboseTrap(), clang::Sema::CheckCallReturnType(), clang::Sema::CheckCastAlign(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckCompleteVariableDeclaration(), checkCondition(), checkConditionalBlockPointerCompatibility(), clang::Sema::CheckConditionalOperands(), checkConditionalPointerCompatibility(), clang::Sema::checkConstantPointerAuthKey(), clang::Sema::CheckConstraintExpression(), CheckCXX98CompatAccessibleCopy(), clang::Sema::CheckCXXThrowOperand(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), CheckedIntArithmetic(), checkEnumArithmeticConversions(), clang::Sema::CheckEnumConstant(), checkEnumTypesInSwitchStmt(), clang::Sema::CheckExceptionSpecCompatibility(), checkExprMemoryConstraintCompat(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::CheckFloatComparison(), CheckFoldOperand(), clang::Sema::CheckForConstantInitializer(), CheckFormatString(), CheckForModifiableLvalue(), clang::Sema::CheckFunctionCall(), clang::Sema::checkFunctionOrMethodParameterIndex(), clang::Sema::CheckImplicitConversion(), CheckIncrementDecrementOperand(), checkIndirectCopyRestoreSource(), CheckIndirectionOperand(), CheckKeyForObjCARCConversion(), clang::SemaRISCV::CheckLMUL(), clang::Sema::CheckLogicalOperands(), checkMapClauseExpressionBase(), checkMapConflicts(), checkMappableExpressionList(), clang::Sema::CheckMemberOperatorAccess(), clang::Sema::CheckMemberPointerConversion(), clang::SemaObjC::CheckMessageArgumentTypes(), clang::SemaARM::CheckNeonBuiltinFunctionCall(), clang::interp::CheckNewDeleteForms(), CheckNonNullArgument(), CheckObjCCollectionLiteralElement(), clang::SemaObjC::CheckObjCForCollectionOperand(), checkObjCPointerIntrospection(), clang::SemaObjC::CheckObjCString(), checkOpenCLConditionVector(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), checkOpenMPIterationSpace(), checkOpenMPLoop(), clang::Sema::CheckPackExpansion(), clang::checkPipeArg(), clang::checkPipePacketType(), checkPointerAuthEnabled(), checkPointerAuthValue(), clang::Sema::CheckPointerConversion(), checkPointerIntegerMismatch(), clang::Sema::CheckPointerToMemberOperands(), clang::SemaPPC::CheckPPCBuiltinFunctionCall(), checkPreviousOMPAllocateAttribute(), clang::Sema::CheckRegparmAttr(), checkSimdlenSafelenSpecified(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckSizelessVectorOperands(), checkSizelessVectorShift(), clang::SemaARM::CheckSMEBuiltinFunctionCall(), clang::Sema::CheckStaticArrayArgument(), CheckStringInit(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckSwitchCondition(), clang::SemaSystemZ::CheckSystemZBuiltinFunctionCall(), CheckTautologicalComparison(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), clang::Sema::CheckTemplateIdType(), clang::Sema::CheckTypenameType(), clang::Sema::checkUInt32Argument(), clang::Sema::CheckUnaryExprOrTypeTraitOperand(), clang::Sema::CheckUnresolvedLookupAccess(), clang::Sema::CheckUnresolvedMemberAccess(), checkUnsafeAssignLiteral(), checkUnsafeAssignObject(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::CheckUseOfCXXMethodAsAddressOfOperand(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CheckVectorOperands(), checkVectorShift(), clang::CheckWasmBuiltinArgIsInteger(), clang::CheckWasmBuiltinArgIsTable(), constructDebugPieceForTrackedCondition(), clang::Sema::ConvertVectorExpr(), CopyObject(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateBuiltinUnaryOp(), clang::Sema::CreateGenericSelectionExpr(), clang::Sema::CreateLaunchBoundsAttr(), CreateNewFunctionDecl(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::CXXCheckConditionalOperands(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), clang::Sema::deduceVarTypeFromInitializer(), clang::InitializationSequence::Diagnose(), diagnoseAddressOfInvalidType(), clang::Sema::DiagnoseAlwaysNonNullPointer(), diagnoseAmbiguousConversion(), diagnoseArithmeticOnTwoFunctionPointers(), diagnoseArithmeticOnTwoVoidPointers(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::Sema::DiagnoseAssignmentResult(), diagnoseBadCast(), DiagnoseBadDivideOrRemainderValues(), DiagnoseBadFunctionCast(), DiagnoseBadShiftValues(), DiagnoseCastOfObjCSEL(), clang::Sema::DiagnoseCommaOperator(), clang::Sema::DiagnoseConditionalForNull(), DiagnoseConstAssignment(), diagnoseDistinctPointerComparison(), DiagnoseDivisionSizeofPointerOrArray(), clang::Sema::DiagnoseEqualityWithExtraParens(), DiagnoseFailedExplicitSpec(), DiagnoseFloatingImpCast(), diagnoseFunctionPointerToVoidComparison(), clang::Sema::DiagnoseImmediateEscalatingReason(), DiagnoseImpCast(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), DiagnoseNarrowingInInitList(), DiagnoseNullConversion(), diagnosePointerIncompatibility(), DiagnoseRecursiveConstFields(), diagnoseRepeatedUseOfWeak(), clang::diagnoseRetainCycle(), DiagnoseSelfAssignment(), clang::Sema::DiagnoseSelfMove(), DiagnoseShiftCompare(), diagnoseTautologicalComparison(), DiagnoseUninitializedConstRefUse(), diagnoseUnknownAnyExpr(), DiagnoseUnusedComparison(), diagnoseWellFormedUnsatisfiedConstraintExpr(), clang::Sema::diagnoseZeroToNullptrConversion(), DiagRecursiveConstraintEval(), DiagUninitUse(), doRewriteToUTF8StringBoxedExpressionHelper(), emitAndFixInvalidAsmCastLValue(), emitBug(), EmitDiagnosticForLogicalAndInLogicalOr(), clang::CodeGen::CGOpenMPRuntime::emitIfClause(), EvaluateArrayTypeTrait(), clang::Sema::EvaluateConvertedConstantExpression(), clang::Sema::FinalizeDeclaration(), clang::SemaObjC::FindCompositeObjCPointerType(), FindConditionalOverload(), clang::findRetainCycleOwner(), findSubobject(), findTemplateParameterInType(), finishContextualImplicitConversion(), clang::ento::CallEvent::getArgSourceRange(), clang::ParmVarDecl::getDefaultArgRange(), clang::syntax::TreeBuilder::getExprRange(), clang::Sema::getExprRange(), clang::CountAttributedTypeLoc::getLocalSourceRange(), getNumThreads(), getPrivateItem(), clang::interp::SourceInfo::getRange(), clang::ObjCMessageExpr::getReceiverRange(), clang::ento::CallEvent::getSourceRange(), clang::CXXStdInitializerListExpr::getSourceRange(), clang::CapturedStmt::getSourceRange(), clang::TemplateArgumentLoc::getSourceRange(), clang::ento::ObjCMethodCall::getSourceRange(), GetUnreachableLoc(), handleCallbackAttr(), HandleConstructorCall(), clang::SemaObjC::HandleExprPropertyRefExpr(), handleFormatArgAttr(), handleFormatAttr(), HandleFunctionCall(), handleInitPriorityAttr(), clang::SemaM68k::handleInterruptAttr(), clang::SemaMSP430::handleInterruptAttr(), handleIntIntBinOp(), handleLayoutVersion(), handleNonNullAttr(), handleOpenCLUnrollHint(), handleOwnershipAttr(), handlePassObjectSizeAttr(), handleSentinelAttr(), handleWorkGroupSize(), clang::Expr::IgnoreUnlessSpelledInSource(), clang::Sema::ImpCastExprToType(), clang::interp::IncDecHelper(), clang::interp::interp__builtin_is_constant_evaluated(), clang::Sema::InvalidLogicalVectorOperands(), clang::Sema::InvalidOperands(), isConfigurationValue(), isNonNegativeIntegerValue(), isNullPointerValueTemplateArgument(), clang::Expr::isUnusedResultAWarning(), LookupMemberExpr(), LookupMemberExprInRecord(), makeLaunchBoundsArgExpr(), clang::interp::InterpState::maybeDiagnoseDanglingAllocations(), clang::Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), maybePutParensOnReceiver(), clang::interp::Neg(), objectifyExpr(), OpenCLArithmeticConversions(), clang::Parser::ParseConstraintLogicalAndExpression(), clang::SemaARM::ParseSVEImmChecks(), clang::ento::ConditionBRVisitor::patternMatch(), clang::InitializationSequence::Perform(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformContextuallyConvertToBool(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformImplicitObjectArgumentInitialization(), clang::Sema::PerformObjectMemberConversion(), PointerAuthStringDiscriminator(), populateExecutedLinesWithFunctionSignature(), printExprAsWritten(), printIndicesOfElementsToConstructJson(), printPendingInitLoopJson(), clang::tooling::reallyIgnoreImplicit(), recordConversion(), clang::tooling::replaceStmtWithStmt(), clang::tooling::replaceStmtWithText(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), resolveBuiltinNewDeleteOverload(), clang::edit::rewriteObjCRedundantCallWithLiteral(), rewriteToArrayLiteral(), rewriteToArraySubscriptSet(), rewriteToBoolLiteral(), rewriteToCharLiteral(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNumberLiteral(), rewriteToNumericBoxedExpression(), rewriteToSubscriptGetCommon(), clang::TreeTransform< Derived >::TransformExprs(), tryDiagnoseOverloadedCast(), TryOrBuildParenListInitialization(), TryReinterpretCast(), clang::ConversionFixItGenerator::tryToFixConversion(), clang::Sema::tryToRecoverWithCall(), clang::Sema::ValueIsRunOfOnes(), clang::Sema::VerifyBitField(), clang::Sema::VerifyIntegerConstantExpression(), clang::SemaOpenMP::VerifyPositiveIntegerConstantInClause(), clang::ASTNodeImporter::VisitCXXNewExpr(), clang::ASTNodeImporter::VisitCXXTypeidExpr(), and clang::Sema::WarnOnPendingNoDerefs().

◆ getStmtClass()

StmtClass clang::Stmt::getStmtClass ( ) const
inline

◆ getStmtClassName()

const char * Stmt::getStmtClassName ( ) const

◆ IgnoreContainers() [1/2]

Stmt * Stmt::IgnoreContainers ( bool  IgnoreCaptured = false)

◆ IgnoreContainers() [2/2]

const Stmt * clang::Stmt::IgnoreContainers ( bool  IgnoreCaptured = false) const
inline

Definition at line 1436 of file Stmt.h.

References IgnoreContainers().

◆ operator delete() [1/5]

void clang::Stmt::operator delete ( void *  ,
const ASTContext ,
unsigned   
)
inlinenoexcept

Definition at line 1294 of file Stmt.h.

◆ operator delete() [2/5]

void clang::Stmt::operator delete ( void *  ,
const ASTContext ,
unsigned   
)
inlinenoexcept

Definition at line 1295 of file Stmt.h.

◆ operator delete() [3/5]

void clang::Stmt::operator delete ( void *  ,
size_t   
)
inlinenoexcept

Definition at line 1296 of file Stmt.h.

◆ operator delete() [4/5]

void clang::Stmt::operator delete ( void *  ,
void *   
)
inlinenoexcept

Definition at line 1297 of file Stmt.h.

◆ operator delete() [5/5]

void clang::Stmt::operator delete ( void *  data)
inlineprotectednoexcept

Definition at line 106 of file Stmt.h.

◆ operator new() [1/4]

void * clang::Stmt::operator new ( size_t  bytes)
inlineprotectednoexcept

Definition at line 102 of file Stmt.h.

◆ operator new() [2/4]

void * Stmt::operator new ( size_t  bytes,
const ASTContext C,
unsigned  alignment = 8 
)

Definition at line 74 of file Stmt.cpp.

References bytes(), and clang::C.

◆ operator new() [3/4]

void * clang::Stmt::operator new ( size_t  bytes,
const ASTContext C,
unsigned  alignment = 8 
)
inline

Definition at line 1287 of file Stmt.h.

References bytes(), and clang::C.

◆ operator new() [4/4]

void * clang::Stmt::operator new ( size_t  bytes,
void *  mem 
)
inlinenoexcept

Definition at line 1292 of file Stmt.h.

◆ operator=() [1/2]

Stmt & clang::Stmt::operator= ( const Stmt )
delete

◆ operator=() [2/2]

Stmt & clang::Stmt::operator= ( Stmt &&  )
delete

◆ printJson()

void Stmt::printJson ( raw_ostream &  Out,
PrinterHelper Helper,
const PrintingPolicy Policy,
bool  AddQuotes 
) const

Pretty-prints in JSON format.

Definition at line 2830 of file StmtPrinter.cpp.

References clang::JsonFormat(), and printPretty().

◆ printPretty()

void Stmt::printPretty ( raw_ostream &  OS,
PrinterHelper Helper,
const PrintingPolicy Policy,
unsigned  Indentation = 0,
StringRef  NewlineSymbol = "\n",
const ASTContext Context = nullptr 
) const

◆ printPrettyControlled()

void Stmt::printPrettyControlled ( raw_ostream &  OS,
PrinterHelper Helper,
const PrintingPolicy Policy,
unsigned  Indentation = 0,
StringRef  NewlineSymbol = "\n",
const ASTContext Context = nullptr 
) const

Definition at line 2822 of file StmtPrinter.cpp.

References P.

◆ PrintStats()

void Stmt::PrintStats ( )
static

◆ ProcessODRHash()

void Stmt::ProcessODRHash ( llvm::FoldingSetNodeID &  ID,
ODRHash Hash 
) const

Calculate a unique representation for a statement that is stable across compiler invocations.

Parameters
IDprofile information will be stored in ID.
Hashan ODRHash object which will be called where pointers would have been used in the Profile function.

Definition at line 2656 of file StmtProfile.cpp.

◆ Profile()

void Stmt::Profile ( llvm::FoldingSetNodeID &  ID,
const ASTContext Context,
bool  Canonical,
bool  ProfileLambdaExpr = false 
) const

Produce a unique representation of the given statement.

Parameters
IDonce the profiling operation is complete, will contain the unique representation of the given statement.
Contextthe AST context in which the statement resides
Canonicalwhether the profile should be based on the canonical representation of this statement (e.g., where non-type template parameters are identified by index/level rather than their declaration pointers) or the exact representation of the statement as written in the source.
ProfileLambdaExprwhether or not to profile lambda expressions. When false, the lambda expressions are never considered to be equal to other lambda expressions. When true, the lambda expressions with the same implementation will be considered to be the same. ProfileLambdaExpr should only be true when we try to merge two declarations within modules.

Definition at line 2650 of file StmtProfile.cpp.

Referenced by actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAtomicDirective(), clang::Sema::AreConstraintExpressionsEqual(), checkDeducedTemplateArguments(), clang::CheckEquivalentExceptionSpecImpl(), checkPreviousOMPAllocateAttribute(), DiagRecursiveConstraintEval(), getAllocatorKind(), clang::ASTContext::hasSameExpr(), IsOverloadOrOverrideImpl(), clang::ASTContext::isSameConstraintExpr(), clang::ASTContext::isSameDefaultTemplateArgument(), isSameTemplateArg(), clang::Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), clang::APValue::Profile(), clang::TemplateArgument::Profile(), clang::DependentBitIntType::Profile(), clang::DependentDecltypeType::Profile(), clang::DependentTypeOfExprType::Profile(), clang::DependentVectorType::Profile(), clang::DependentSizedMatrixType::Profile(), clang::DependentSizedExtVectorType::Profile(), clang::DependentSizedArrayType::Profile(), clang::PackIndexingType::Profile(), clang::DependentAddressSpaceType::Profile(), and clang::ConstantArrayType::Profile().

◆ stripLabelLikeStatements() [1/2]

Stmt * clang::Stmt::stripLabelLikeStatements ( )
inline

Definition at line 1441 of file Stmt.h.

References stripLabelLikeStatements().

◆ stripLabelLikeStatements() [2/2]

const Stmt * Stmt::stripLabelLikeStatements ( ) const

Strip off all label-like statements.

This will strip off label statements, case statements, attributed statements and default statements recursively.

Definition at line 219 of file Stmt.cpp.

Referenced by stripLabelLikeStatements().

◆ viewAST()

void Stmt::viewAST ( ) const

viewAST - Visualize an AST rooted at this Stmt* using GraphViz.

Only works on systems with GraphViz (Mac OS X) or dot+gv installed.

Definition at line 20 of file StmtViz.cpp.

Friends And Related Function Documentation

◆ ASTStmtReader

friend class ASTStmtReader
friend

Definition at line 99 of file Stmt.h.

◆ ASTStmtWriter

friend class ASTStmtWriter
friend

Definition at line 100 of file Stmt.h.

Member Data Documentation

◆ 

union { ... } clang::Stmt::@84

◆ ArrayOrMatrixSubscriptExprBits

ArrayOrMatrixSubscriptExprBitfields clang::Stmt::ArrayOrMatrixSubscriptExprBits

◆ AttributedStmtBits

AttributedStmtBitfields clang::Stmt::AttributedStmtBits

Definition at line 1209 of file Stmt.h.

Referenced by clang::AttributedStmt::getAttrLoc(), and clang::AttributedStmt::getAttrs().

◆ BinaryOperatorBits

BinaryOperatorBitfields clang::Stmt::BinaryOperatorBits

◆ BreakStmtBits

BreakStmtBitfields clang::Stmt::BreakStmtBits

Definition at line 1217 of file Stmt.h.

Referenced by clang::BreakStmt::getBreakLoc(), and clang::BreakStmt::setBreakLoc().

◆ CallExprBits

CallExprBitfields clang::Stmt::CallExprBits

◆ CastExprBits

CastExprBitfields clang::Stmt::CastExprBits

◆ CharacterLiteralBits

CharacterLiteralBitfields clang::Stmt::CharacterLiteralBits

◆ CoawaitBits

CoawaitExprBitfields clang::Stmt::CoawaitBits

◆ CompoundStmtBits

CompoundStmtBitfields clang::Stmt::CompoundStmtBits

◆ ConstantExprBits

ConstantExprBitfields clang::Stmt::ConstantExprBits

◆ ContinueStmtBits

ContinueStmtBitfields clang::Stmt::ContinueStmtBits

◆ CXXBoolLiteralExprBits

CXXBoolLiteralExprBitfields clang::Stmt::CXXBoolLiteralExprBits

◆ CXXConstructExprBits

CXXConstructExprBitfields clang::Stmt::CXXConstructExprBits

◆ CXXDefaultArgExprBits

CXXDefaultArgExprBitfields clang::Stmt::CXXDefaultArgExprBits

◆ CXXDefaultInitExprBits

CXXDefaultInitExprBitfields clang::Stmt::CXXDefaultInitExprBits

◆ CXXDeleteExprBits

CXXDeleteExprBitfields clang::Stmt::CXXDeleteExprBits

◆ CXXDependentScopeMemberExprBits

CXXDependentScopeMemberExprBitfields clang::Stmt::CXXDependentScopeMemberExprBits

◆ CXXNewExprBits

CXXNewExprBitfields clang::Stmt::CXXNewExprBits

◆ CXXNoexceptExprBits

CXXNoexceptExprBitfields clang::Stmt::CXXNoexceptExprBits

◆ CXXNullPtrLiteralExprBits

CXXNullPtrLiteralExprBitfields clang::Stmt::CXXNullPtrLiteralExprBits

◆ CXXOperatorCallExprBits

CXXOperatorCallExprBitfields clang::Stmt::CXXOperatorCallExprBits

Definition at line 1246 of file Stmt.h.

Referenced by clang::CXXOperatorCallExpr::getOperator().

◆ CXXRewrittenBinaryOperatorBits

CXXRewrittenBinaryOperatorBitfields clang::Stmt::CXXRewrittenBinaryOperatorBits

◆ CXXScalarValueInitExprBits

CXXScalarValueInitExprBitfields clang::Stmt::CXXScalarValueInitExprBits

◆ CXXThisExprBits

CXXThisExprBitfields clang::Stmt::CXXThisExprBits

◆ CXXThrowExprBits

CXXThrowExprBitfields clang::Stmt::CXXThrowExprBits

◆ CXXUnresolvedConstructExprBits

CXXUnresolvedConstructExprBitfields clang::Stmt::CXXUnresolvedConstructExprBits

Definition at line 1261 of file Stmt.h.

Referenced by clang::CXXUnresolvedConstructExpr::getNumArgs().

◆ DeclRefExprBits

DeclRefExprBitfields clang::Stmt::DeclRefExprBits

◆ DependentScopeDeclRefExprBits

DependentScopeDeclRefExprBitfields clang::Stmt::DependentScopeDeclRefExprBits

Definition at line 1258 of file Stmt.h.

Referenced by clang::DependentScopeDeclRefExpr::CreateEmpty().

◆ DoStmtBits

DoStmtBitfields clang::Stmt::DoStmtBits

Definition at line 1213 of file Stmt.h.

Referenced by clang::DoStmt::getDoLoc(), and clang::DoStmt::setDoLoc().

◆ ExprBits

ExprBitfields clang::Stmt::ExprBits

◆ ExprWithCleanupsBits

ExprWithCleanupsBitfields clang::Stmt::ExprWithCleanupsBits

◆ FloatingLiteralBits

FloatingLiteralBitfields clang::Stmt::FloatingLiteralBits

◆ ForStmtBits

ForStmtBitfields clang::Stmt::ForStmtBits

◆ GenericSelectionExprBits

GenericSelectionExprBitfields clang::Stmt::GenericSelectionExprBits

Definition at line 1238 of file Stmt.h.

Referenced by clang::GenericSelectionExpr::getGenericLoc().

◆ GotoStmtBits

GotoStmtBitfields clang::Stmt::GotoStmtBits

◆ IfStmtBits

IfStmtBitfields clang::Stmt::IfStmtBits

◆ InitListExprBits

InitListExprBitfields clang::Stmt::InitListExprBits

◆ LabelStmtBits

LabelStmtBitfields clang::Stmt::LabelStmtBits

Definition at line 1208 of file Stmt.h.

Referenced by clang::LabelStmt::getIdentLoc(), and clang::LabelStmt::setIdentLoc().

◆ LambdaExprBits

LambdaExprBitfields clang::Stmt::LambdaExprBits

◆ MemberExprBits

MemberExprBitfields clang::Stmt::MemberExprBits

◆ NullStmtBits

NullStmtBitfields clang::Stmt::NullStmtBits

◆ ObjCIndirectCopyRestoreExprBits

ObjCIndirectCopyRestoreExprBitfields clang::Stmt::ObjCIndirectCopyRestoreExprBits

Definition at line 1275 of file Stmt.h.

Referenced by clang::ObjCIndirectCopyRestoreExpr::shouldCopy().

◆ OpaqueValueExprBits

OpaqueValueExprBitfields clang::Stmt::OpaqueValueExprBits

◆ OverloadExprBits

OverloadExprBitfields clang::Stmt::OverloadExprBits

◆ ParenListExprBits

ParenListExprBitfields clang::Stmt::ParenListExprBits

Definition at line 1237 of file Stmt.h.

Referenced by clang::ParenListExpr::getNumExprs().

◆ PredefinedExprBits

PredefinedExprBitfields clang::Stmt::PredefinedExprBits

◆ PseudoObjectExprBits

PseudoObjectExprBitfields clang::Stmt::PseudoObjectExprBits

◆ RequiresExprBits

RequiresExprBitfields clang::Stmt::RequiresExprBits

◆ ReturnStmtBits

ReturnStmtBitfields clang::Stmt::ReturnStmtBits

Definition at line 1218 of file Stmt.h.

Referenced by clang::ReturnStmt::getReturnLoc(), and clang::ReturnStmt::setReturnLoc().

◆ SourceLocExprBits

SourceLocExprBitfields clang::Stmt::SourceLocExprBits

◆ StmtBits

StmtBitfields clang::Stmt::StmtBits

Definition at line 1205 of file Stmt.h.

Referenced by getStmtClass(), getStmtClassName(), and Stmt().

◆ StmtExprBits

StmtExprBitfields clang::Stmt::StmtExprBits

Definition at line 1243 of file Stmt.h.

Referenced by clang::StmtExpr::getTemplateDepth(), and clang::StmtExpr::StmtExpr().

◆ StringLiteralBits

StringLiteralBitfields clang::Stmt::StringLiteralBits

◆ SubstNonTypeTemplateParmExprBits

SubstNonTypeTemplateParmExprBitfields clang::Stmt::SubstNonTypeTemplateParmExprBits

◆ SwitchCaseBits

SwitchCaseBitfields clang::Stmt::SwitchCaseBits

◆ SwitchStmtBits

SwitchStmtBitfields clang::Stmt::SwitchStmtBits

◆ TypeTraitExprBits

TypeTraitExprBitfields clang::Stmt::TypeTraitExprBits

◆ UnaryExprOrTypeTraitExprBits

UnaryExprOrTypeTraitExprBitfields clang::Stmt::UnaryExprOrTypeTraitExprBits

◆ UnaryOperatorBits

UnaryOperatorBitfields clang::Stmt::UnaryOperatorBits

◆ UnresolvedLookupExprBits

UnresolvedLookupExprBitfields clang::Stmt::UnresolvedLookupExprBits

Definition at line 1264 of file Stmt.h.

Referenced by clang::UnresolvedLookupExpr::requiresADL().

◆ UnresolvedMemberExprBits

UnresolvedMemberExprBitfields clang::Stmt::UnresolvedMemberExprBits

◆ WhileStmtBits

WhileStmtBitfields clang::Stmt::WhileStmtBits

The documentation for this class was generated from the following files: