clang  14.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]
Collaboration diagram for clang::Stmt:
Collaboration 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/subexpessions of an AST node. More...
 
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. More...
 
SourceLocation getBeginLoc () const LLVM_READONLY
 
SourceLocation getEndLoc () const LLVM_READONLY
 
void dump () const
 Dumps the specified AST fragment and all subtrees to llvm::errs(). More...
 
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. More...
 
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. More...
 
void printPretty (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. More...
 
void viewAST () const
 viewAST - Visualize an AST rooted at this Stmt* using GraphViz. More...
 
StmtIgnoreContainers (bool IgnoreCaptured=false)
 Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true. More...
 
const StmtIgnoreContainers (bool IgnoreCaptured=false) const
 
const StmtstripLabelLikeStatements () const
 Strip off all label-like statements. More...
 
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) const
 Produce a unique representation of the given statement. More...
 
void ProcessODRHash (llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
 Calculate a unique representation for a statement that is stable across compiler invocations. More...
 

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 *. More...
 
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. More...
 

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 69 of file Stmt.h.

Member Typedef Documentation

◆ child_iterator

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

This permits easy iteration over all nodes in the AST.

Definition at line 1244 of file Stmt.h.

◆ child_range

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

Definition at line 1247 of file Stmt.h.

◆ const_child_iterator

Definition at line 1245 of file Stmt.h.

◆ const_child_range

Definition at line 1248 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 1134 of file Stmt.h.

◆ ConstExprIterator

Definition at line 1137 of file Stmt.h.

◆ ExprIterator

Definition at line 1136 of file Stmt.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
NumStmtBits 

Definition at line 105 of file Stmt.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumExprBits 

Definition at line 317 of file Stmt.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumCallExprBits 

Definition at line 479 of file Stmt.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumOverloadExprBits 

Definition at line 878 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 1106 of file Stmt.h.

◆ StmtClass

Enumerator
NoStmtClass 

Definition at line 71 of file Stmt.h.

Constructor & Destructor Documentation

◆ Stmt() [1/5]

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

Construct an empty statement.

Definition at line 1145 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 1154 of file Stmt.h.

References addStmtClass(), and StmtBits.

Member Function Documentation

◆ addStmtClass()

void Stmt::addStmtClass ( const StmtClass  s)
static

Definition at line 124 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 1260 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 1261 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 1252 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 183 of file Stmt.cpp.

References getLikelihood(), and LH_None.

◆ dump() [1/2]

LLVM_DUMP_METHOD void Stmt::dump ( ) const

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

Definition at line 231 of file ASTDumper.cpp.

References P.

Referenced by clang::AnyCall::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 242 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 2585 of file StmtPrinter.cpp.

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

◆ EnableStatistics()

void Stmt::EnableStatistics ( )
static

Definition at line 129 of file Stmt.cpp.

◆ getBeginLoc()

SourceLocation Stmt::getBeginLoc ( ) const

Definition at line 336 of file Stmt.cpp.

References getStmtClass(), and NoStmtClass.

Referenced by clang::Sema::ActOnFinishCXXInClassMemberInitializer(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnGCCAsmStmt(), clang::Sema::ActOnNoexceptSpec(), clang::Sema::ActOnOpenMPAtomicDirective(), clang::Sema::ActOnOpenMPDistScheduleClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPOrderedDirective(), clang::Sema::ActOnOpenMPScheduleClause(), clang::Sema::ActOnOpenMPUnrollDirective(), clang::Sema::ActOnStmtExprResult(), clang::Sema::AddAllocAlignAttr(), clang::Sema::AddAnnotationAttr(), clang::Sema::BuildArrayType(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildCallExpr(), clang::Sema::BuildCXXThrow(), clang::Sema::BuildInstanceMessage(), BuildNonArrayForRange(), clang::Sema::BuildResolvedCallExpr(), clang::Sema::BuildReturnStmt(), clang::Sema::BuildVAArgExpr(), clang::Sema::CanPerformCopyInitialization(), CastForMoving(), clang::Sema::CheckAddressOfOperand(), clang::Sema::CheckAssignmentOperands(), CheckConstexprFunctionBody(), clang::Sema::CheckConversionToObjCLiteral(), clang::Sema::checkDeclIsAllowedInOpenMPTarget(), CheckICE(), clang::Sema::CheckImplementationIvars(), clang::Sema::CheckObjCBridgeRelatedConversions(), clang::Sema::checkOpenMPDeclareVariantFunction(), checkOpenMPLoop(), clang::Sema::CheckPlaceholderExpr(), clang::Sema::CheckPointerToMemberOperands(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::checkStringLiteralArgumentAttr(), clang::Sema::CheckTemplateArgument(), clang::Sema::checkVariadicArgument(), ConvertForConditional(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CreateBuiltinMatrixSubscriptExpr(), clang::Sema::DiagnoseAssignmentAsCondition(), DiagnoseBitwisePrecedence(), DiagnoseCastQual(), clang::Sema::DiagnoseCommaOperator(), DiagnoseConditionalPrecedence(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), diagnoseNoViableConversion(), diagnoseStringPlusChar(), diagnoseStringPlusInt(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::Sema::diagnoseZeroToNullptrConversion(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), emitOutlinedFunctionPrologue(), findOpenParen(), clang::Sema::GatherArgumentsForCall(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::OMPArraySectionExpr::getBeginLoc(), clang::StmtSequence::getBeginLoc(), clang::OMPCanonicalLoop::getBeginLoc(), clang::CXXRewrittenBinaryOperator::getBeginLoc(), clang::CoroutineBodyStmt::getBeginLoc(), clang::ObjCIvarRefExpr::getBeginLoc(), clang::UserDefinedLiteral::getBeginLoc(), clang::ObjCPropertyRefExpr::getBeginLoc(), clang::CXXStdInitializerListExpr::getBeginLoc(), clang::ObjCSubscriptRefExpr::getBeginLoc(), clang::MSPropertyRefExpr::getBeginLoc(), clang::MSPropertySubscriptExpr::getBeginLoc(), clang::ConstantExpr::getBeginLoc(), clang::OpaqueValueExpr::getBeginLoc(), clang::CXXBindTemporaryExpr::getBeginLoc(), clang::ObjCIsaExpr::getBeginLoc(), clang::ImaginaryLiteral::getBeginLoc(), clang::ArraySubscriptExpr::getBeginLoc(), clang::MatrixSubscriptExpr::getBeginLoc(), clang::CallExpr::getBeginLoc(), clang::MemberExpr::getBeginLoc(), clang::ExprWithCleanups::getBeginLoc(), clang::ImplicitCastExpr::getBeginLoc(), clang::CapturedStmt::getBeginLoc(), clang::BinaryOperator::getBeginLoc(), clang::PackExpansionExpr::getBeginLoc(), clang::ConditionalOperator::getBeginLoc(), clang::BinaryConditionalOperator::getBeginLoc(), clang::MaterializeTemporaryExpr::getBeginLoc(), clang::CXXFoldExpr::getBeginLoc(), clang::DesignatedInitUpdateExpr::getBeginLoc(), clang::ExtVectorElementExpr::getBeginLoc(), clang::PseudoObjectExpr::getBeginLoc(), clang::CXXRewrittenBinaryOperator::getSourceRange(), clang::Sema::ImpCastExprToType(), clang::Sema::InstantiateDefaultArgument(), clang::AnalysisDeclContext::isBodyAutosynthesizedFromModelFile(), clang::Sema::IsIntegralPromotion(), clang::Sema::IsMemberPointerConversion(), clang::Sema::IsPointerConversion(), clang::Expr::isUnusedResultAWarning(), clang::Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), clang::Parser::ParseConstraintLogicalAndExpression(), clang::ento::ConditionBRVisitor::patternMatch(), clang::Sema::PerformContextuallyConvertToBool(), clang::Sema::PerformCopyInitialization(), clang::Sema::PerformImplicitConversion(), clang::ProgramPoint::printJson(), clang::ento::ExprEngine::ProcessStmt(), removePunyEdges(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), rewriteToArrayLiteral(), rewriteToDictionaryLiteral(), clang::Sema::SemaBuiltinShuffleVector(), clang::CodeGen::CodeGenFunction::setBlockContextParameter(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), clang::Sema::SubstParmVarDecl(), clang::Sema::TemplateParameterListsAreEqual(), TryClassUnification(), clang::Sema::tryConvertExprToType(), TryLValueToRValueCast(), clang::Sema::VerifyIntegerConstantExpression(), clang::ASTNodeImporter::VisitExpr(), and clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode().

◆ getEndLoc()

SourceLocation Stmt::getEndLoc ( ) const

Definition at line 348 of file Stmt.cpp.

References getStmtClass(), and NoStmtClass.

Referenced by clang::Sema::ActOnFinishCXXInClassMemberInitializer(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnIfStmt(), clang::Sema::ActOnLambdaExpr(), clang::Sema::ActOnOpenMPUnrollDirective(), clang::Sema::BuildCStyleCastExpr(), clang::Sema::BuildCXXFunctionalCastExpr(), clang::Sema::CheckLogicalOperands(), clang::Sema::CheckObjCBridgeRelatedConversions(), clang::Sema::CheckPointerToMemberOperands(), clang::Sema::CreateBuiltinBinOp(), clang::ento::CXXDestructorCall::CXXDestructorCall(), DiagnoseBitwisePrecedence(), clang::Sema::DiagnoseCommaOperator(), DiagnoseConditionalPrecedence(), diagnoseNoViableConversion(), clang::Sema::DiagnoseSentinelCalls(), diagnoseStringPlusChar(), diagnoseStringPlusInt(), clang::CodeGen::CodeGenFunction::GenerateSEHFilterFunction(), clang::CodeGen::CodeGenFunction::GenerateSEHFinallyFunction(), clang::ObjCIsaExpr::getBaseLocEnd(), clang::CXXCatchStmt::getEndLoc(), clang::ObjCForCollectionStmt::getEndLoc(), clang::ObjCStringLiteral::getEndLoc(), clang::CXXTryStmt::getEndLoc(), clang::ObjCAtCatchStmt::getEndLoc(), clang::StmtSequence::getEndLoc(), clang::ObjCAtFinallyStmt::getEndLoc(), clang::OMPCanonicalLoop::getEndLoc(), clang::OMPArrayShapingExpr::getEndLoc(), clang::CXXForRangeStmt::getEndLoc(), clang::ObjCAtTryStmt::getEndLoc(), clang::MSDependentExistsStmt::getEndLoc(), clang::CXXRewrittenBinaryOperator::getEndLoc(), clang::ObjCAtThrowStmt::getEndLoc(), clang::ObjCAutoreleasePoolStmt::getEndLoc(), clang::CoroutineBodyStmt::getEndLoc(), clang::CoreturnStmt::getEndLoc(), clang::CXXStdInitializerListExpr::getEndLoc(), clang::ConstantExpr::getEndLoc(), clang::OpaqueValueExpr::getEndLoc(), clang::CXXThrowExpr::getEndLoc(), clang::CXXBindTemporaryExpr::getEndLoc(), clang::CXXConstructExpr::getEndLoc(), clang::ObjCBridgedCastExpr::getEndLoc(), clang::CaseStmt::getEndLoc(), clang::ImaginaryLiteral::getEndLoc(), clang::DefaultStmt::getEndLoc(), clang::CXXFunctionalCastExpr::getEndLoc(), clang::LabelStmt::getEndLoc(), clang::CXXTemporaryObjectExpr::getEndLoc(), clang::AttributedStmt::getEndLoc(), clang::IfStmt::getEndLoc(), clang::SwitchStmt::getEndLoc(), clang::CXXDeleteExpr::getEndLoc(), clang::WhileStmt::getEndLoc(), clang::ForStmt::getEndLoc(), clang::ReturnStmt::getEndLoc(), clang::CallExpr::getEndLoc(), clang::MemberExpr::getEndLoc(), clang::ExprWithCleanups::getEndLoc(), clang::SEHTryStmt::getEndLoc(), clang::CXXUnresolvedConstructExpr::getEndLoc(), clang::ImplicitCastExpr::getEndLoc(), clang::CapturedStmt::getEndLoc(), clang::CStyleCastExpr::getEndLoc(), clang::BinaryOperator::getEndLoc(), clang::ConditionalOperator::getEndLoc(), clang::BinaryConditionalOperator::getEndLoc(), clang::MaterializeTemporaryExpr::getEndLoc(), clang::CXXFoldExpr::getEndLoc(), clang::CoroutineSuspendExpr::getEndLoc(), clang::DependentCoawaitExpr::getEndLoc(), clang::DesignatedInitExpr::getEndLoc(), clang::DesignatedInitUpdateExpr::getEndLoc(), clang::BlockExpr::getEndLoc(), clang::PseudoObjectExpr::getEndLoc(), clang::CXXRewrittenBinaryOperator::getSourceRange(), clang::FieldDecl::getSourceRange(), clang::EnumConstantDecl::getSourceRange(), clang::ConceptDecl::getSourceRange(), clang::BlockDecl::getSourceRange(), clang::Expr::isUnusedResultAWarning(), clang::Parser::ParseConstraintLogicalAndExpression(), clang::ento::ConditionBRVisitor::patternMatch(), rewriteToArrayLiteral(), rewriteToDictionaryLiteral(), clang::consumed::ConsumedAnalyzer::run(), clang::Sema::SemaBuiltinShuffleVector(), clang::FunctionDecl::setBody(), and clang::Declarator::setTrailingRequiresClause().

◆ 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 153 of file Stmt.cpp.

References getLikelihood().

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 157 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 165 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 161 of file Stmt.cpp.

◆ 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 324 of file Stmt.cpp.

References getStmtClass(), and NoStmtClass.

Referenced by clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnDependentMemberExpr(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnGCCAsmStmt(), clang::Sema::ActOnObjCAtSynchronizedOperand(), clang::Sema::ActOnOMPArraySectionExpr(), clang::Sema::ActOnOpenMPAtomicDirective(), clang::Sema::ActOnOpenMPDeclareSimdDirective(), clang::Sema::ActOnOpenMPDependClause(), clang::Sema::ActOnOpenMPDepobjClause(), clang::Sema::ActOnOpenMPDetachClause(), clang::Sema::ActOnOpenMPDistScheduleClause(), clang::Sema::ActOnOpenMPIsDevicePtrClause(), clang::Sema::ActOnOpenMPScheduleClause(), clang::Sema::ActOnParamDefaultArgument(), clang::Sema::ActOnStartOfSwitchStmt(), clang::Sema::AddAlignedAttr(), clang::Sema::AddAlignValueAttr(), clang::Sema::AddAssumeAlignedAttr(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildArrayType(), clang::Sema::BuildAsTypeExpr(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildDeclaratorGroup(), clang::Sema::BuildExtVectorType(), clang::Sema::BuildInstanceMessage(), clang::Sema::BuildMatrixType(), clang::Sema::BuildNestedRequirement(), clang::Sema::BuildObjCAtThrowStmt(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCBridgedCast(), clang::Sema::BuildObjCNumericLiteral(), clang::Sema::BuildResolvedCallExpr(), clang::Sema::BuildReturnStmt(), clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::BuildUnresolvedCoawaitExpr(), clang::Sema::BuildVAArgExpr(), clang::Sema::BuildVectorLiteral(), clang::Sema::BuildVectorType(), CastForMoving(), clang::Sema::CheckAddressOfMemberAccess(), clang::Sema::CheckAddressOfOperand(), clang::Sema::CheckBooleanCondition(), clang::Sema::CheckCastAlign(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckConditionalOperands(), clang::Sema::CheckConstraintExpression(), clang::Sema::CheckCXXThrowOperand(), clang::Sema::checkDeclIsAllowedInOpenMPTarget(), clang::Sema::CheckEnumConstant(), clang::Sema::CheckExceptionSpecCompatibility(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::CheckFloatComparison(), clang::Sema::CheckLogicalOperands(), checkMapClauseExpressionBase(), checkMapConflicts(), checkMappableExpressionList(), clang::Sema::CheckMemberOperatorAccess(), clang::Sema::CheckMessageArgumentTypes(), clang::Sema::CheckObjCForCollectionOperand(), clang::Sema::checkOpenMPDeclareVariantFunction(), checkOpenMPLoop(), clang::Sema::CheckPackExpansion(), clang::Sema::CheckPointerConversion(), clang::Sema::CheckPointerToMemberOperands(), clang::Sema::CheckRegparmAttr(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckStaticArrayArgument(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckUnaryExprOrTypeTraitOperand(), clang::Sema::CheckUnresolvedLookupAccess(), clang::Sema::CheckUnresolvedMemberAccess(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CheckVectorOperands(), constructDebugPieceForTrackedCondition(), clang::Sema::ConvertArgumentsForCall(), clang::Sema::CreateBuiltinUnaryOp(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::CXXCheckConditionalOperands(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), clang::Sema::DiagnoseAlwaysNonNullPointer(), diagnoseAmbiguousConversion(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseBadFunctionCast(), DiagnoseCastOfObjCSEL(), clang::Sema::DiagnoseCommaOperator(), clang::Sema::DiagnoseConditionalForNull(), clang::Sema::DiagnoseEqualityWithExtraParens(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), clang::Sema::DiagnoseSelfMove(), clang::Sema::diagnoseZeroToNullptrConversion(), doRewriteToUTF8StringBoxedExpressionHelper(), emitBug(), EmitDiagnosticForLogicalAndInLogicalOr(), clang::CodeGen::CGOpenMPRuntime::emitIfClause(), clang::CodeGen::CodeGenFunction::emitImplicitAssignmentOperatorBody(), EvaluateArrayTypeTrait(), clang::Sema::FinalizeDeclaration(), clang::Sema::FindCompositeObjCPointerType(), FindConditionalOverload(), findTemplateParameterInType(), finishContextualImplicitConversion(), clang::ParmVarDecl::getDefaultArgRange(), clang::NonTypeTemplateParmDecl::getDefaultArgumentLoc(), clang::syntax::TreeBuilder::getExprRange(), clang::Sema::getExprRange(), getNumThreads(), clang::Sema::getPrintable(), clang::ObjCMessageExpr::getReceiverRange(), clang::ento::CallEvent::getSourceRange(), clang::TemplateArgumentLoc::getSourceRange(), clang::CXXStdInitializerListExpr::getSourceRange(), clang::ento::ObjCMethodCall::getSourceRange(), clang::CapturedStmt::getSourceRange(), clang::Sema::HandleExprPropertyRefExpr(), clang::Expr::IgnoreUnlessSpelledInSource(), clang::Sema::ImpCastExprToType(), clang::Sema::InvalidLogicalVectorOperands(), clang::Sema::InvalidOperands(), isNonNegativeIntegerValue(), clang::Expr::isUnusedResultAWarning(), LookupMemberExprInRecord(), clang::Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), maybePutParensOnReceiver(), nextPathEntryRange(), objectifyExpr(), clang::Parser::ParseConstraintLogicalAndExpression(), clang::ento::ConditionBRVisitor::patternMatch(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformContextuallyConvertToBool(), clang::Sema::PerformImplicitConversion(), populateExecutedLinesWithFunctionSignature(), printExprAsWritten(), clang::tooling::reallyIgnoreImplicit(), recordConversion(), clang::tooling::replaceStmtWithStmt(), clang::tooling::replaceStmtWithText(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), clang::edit::rewriteObjCRedundantCallWithLiteral(), rewriteToArrayLiteral(), rewriteToArraySubscriptSet(), rewriteToBoolLiteral(), rewriteToCharLiteral(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNumberLiteral(), rewriteToNumericBoxedExpression(), rewriteToSubscriptGetCommon(), clang::Sema::SemaBuiltinShuffleVector(), clang::Sema::SemaConvertVectorExpr(), clang::TreeTransform< Derived >::TransformExprs(), TryReinterpretCast(), clang::Sema::tryToRecoverWithCall(), clang::Sema::VerifyBitField(), and clang::Sema::WarnOnPendingNoDerefs().

◆ getStmtClass()

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

Definition at line 1163 of file Stmt.h.

References StmtBits.

Referenced by CheckICE(), clang::Sema::CheckLiteralKind(), children(), ClassifyInternal(), clang::CXXCatchStmt::classof(), clang::ObjCForCollectionStmt::classof(), clang::ObjCStringLiteral::classof(), clang::CXXTryStmt::classof(), clang::ObjCAtCatchStmt::classof(), clang::ObjCBoolLiteralExpr::classof(), clang::ConceptSpecializationExpr::classof(), clang::OMPArraySectionExpr::classof(), clang::ObjCAtFinallyStmt::classof(), clang::CXXOperatorCallExpr::classof(), clang::ObjCBoxedExpr::classof(), clang::CXXForRangeStmt::classof(), clang::OMPArrayShapingExpr::classof(), clang::CXXMemberCallExpr::classof(), clang::ObjCArrayLiteral::classof(), clang::CUDAKernelCallExpr::classof(), clang::MSDependentExistsStmt::classof(), clang::ObjCAtSynchronizedStmt::classof(), clang::ObjCAtThrowStmt::classof(), clang::CXXRewrittenBinaryOperator::classof(), clang::ObjCAutoreleasePoolStmt::classof(), clang::ObjCDictionaryLiteral::classof(), clang::OMPIteratorExpr::classof(), clang::CXXNamedCastExpr::classof(), clang::CoroutineBodyStmt::classof(), clang::ObjCEncodeExpr::classof(), clang::CXXStaticCastExpr::classof(), clang::ObjCSelectorExpr::classof(), clang::CXXDynamicCastExpr::classof(), clang::CoreturnStmt::classof(), clang::RequiresExpr::classof(), clang::ObjCProtocolExpr::classof(), clang::CXXReinterpretCastExpr::classof(), clang::CXXConstCastExpr::classof(), clang::ObjCIvarRefExpr::classof(), clang::CXXAddrspaceCastExpr::classof(), clang::OMPParallelDirective::classof(), clang::CXXBoolLiteralExpr::classof(), clang::CXXNullPtrLiteralExpr::classof(), clang::ObjCPropertyRefExpr::classof(), clang::CXXTypeidExpr::classof(), clang::ObjCSubscriptRefExpr::classof(), clang::MSPropertyRefExpr::classof(), clang::Expr::classof(), clang::OMPLoopTransformationDirective::classof(), clang::FullExpr::classof(), clang::MSPropertySubscriptExpr::classof(), clang::ConstantExpr::classof(), clang::CXXUuidofExpr::classof(), clang::CXXThisExpr::classof(), clang::OpaqueValueExpr::classof(), clang::CXXThrowExpr::classof(), clang::CXXDefaultArgExpr::classof(), clang::DeclStmt::classof(), clang::CXXDefaultInitExpr::classof(), clang::NullStmt::classof(), clang::DeclRefExpr::classof(), clang::CXXBindTemporaryExpr::classof(), clang::ObjCMessageExpr::classof(), clang::OMPLoopDirective::classof(), clang::CompoundStmt::classof(), clang::IntegerLiteral::classof(), clang::ObjCIsaExpr::classof(), clang::FixedPointLiteral::classof(), clang::OMPSimdDirective::classof(), clang::CharacterLiteral::classof(), clang::CXXConstructExpr::classof(), clang::ObjCBridgedCastExpr::classof(), clang::OMPForDirective::classof(), clang::FloatingLiteral::classof(), clang::CaseStmt::classof(), clang::CXXInheritedCtorInitExpr::classof(), clang::ObjCAvailabilityCheckExpr::classof(), clang::ImaginaryLiteral::classof(), clang::OMPForSimdDirective::classof(), clang::DefaultStmt::classof(), clang::ValueStmt::classof(), clang::OMPSectionsDirective::classof(), clang::LabelStmt::classof(), clang::OMPSectionDirective::classof(), clang::AttributedStmt::classof(), clang::OMPSingleDirective::classof(), clang::StringLiteral::classof(), clang::OMPMasterDirective::classof(), clang::PredefinedExpr::classof(), clang::OMPCriticalDirective::classof(), clang::LambdaExpr::classof(), clang::SYCLUniqueStableNameExpr::classof(), clang::CXXScalarValueInitExpr::classof(), clang::ParenExpr::classof(), clang::IfStmt::classof(), clang::OMPParallelForDirective::classof(), clang::OMPParallelForSimdDirective::classof(), clang::OMPParallelMasterDirective::classof(), clang::UnaryOperator::classof(), clang::SwitchStmt::classof(), clang::OMPParallelSectionsDirective::classof(), clang::CXXNewExpr::classof(), clang::OMPTaskDirective::classof(), clang::CXXDeleteExpr::classof(), clang::WhileStmt::classof(), clang::OMPTaskyieldDirective::classof(), clang::DoStmt::classof(), clang::OMPBarrierDirective::classof(), clang::OffsetOfExpr::classof(), clang::OMPTaskwaitDirective::classof(), clang::ForStmt::classof(), clang::UnaryExprOrTypeTraitExpr::classof(), clang::OMPTaskgroupDirective::classof(), clang::GotoStmt::classof(), clang::IndirectGotoStmt::classof(), clang::OMPFlushDirective::classof(), clang::ArraySubscriptExpr::classof(), clang::ContinueStmt::classof(), clang::TypeTraitExpr::classof(), clang::OMPDepobjDirective::classof(), clang::BreakStmt::classof(), clang::MatrixSubscriptExpr::classof(), clang::OMPOrderedDirective::classof(), clang::ArrayTypeTraitExpr::classof(), clang::ReturnStmt::classof(), clang::ExpressionTraitExpr::classof(), clang::AsmStmt::classof(), clang::OMPAtomicDirective::classof(), clang::OMPTargetDirective::classof(), clang::OMPTargetDataDirective::classof(), clang::OverloadExpr::classof(), clang::OMPTargetEnterDataDirective::classof(), clang::CallExpr::classof(), clang::OMPTargetExitDataDirective::classof(), clang::UnresolvedLookupExpr::classof(), clang::GCCAsmStmt::classof(), clang::OMPTargetParallelDirective::classof(), clang::MSAsmStmt::classof(), clang::DependentScopeDeclRefExpr::classof(), clang::OMPTargetParallelForDirective::classof(), clang::SEHExceptStmt::classof(), clang::OMPTeamsDirective::classof(), clang::MemberExpr::classof(), clang::ExprWithCleanups::classof(), clang::SEHFinallyStmt::classof(), clang::OMPCancellationPointDirective::classof(), clang::SEHTryStmt::classof(), clang::CompoundLiteralExpr::classof(), clang::SEHLeaveStmt::classof(), clang::OMPCancelDirective::classof(), clang::CXXUnresolvedConstructExpr::classof(), clang::OMPTaskLoopDirective::classof(), clang::CastExpr::classof(), clang::OMPTaskLoopSimdDirective::classof(), clang::ImplicitCastExpr::classof(), clang::CapturedStmt::classof(), clang::OMPMasterTaskLoopDirective::classof(), clang::ExplicitCastExpr::classof(), clang::OMPMasterTaskLoopSimdDirective::classof(), clang::CXXDependentScopeMemberExpr::classof(), clang::CStyleCastExpr::classof(), clang::OMPParallelMasterTaskLoopDirective::classof(), clang::OMPParallelMasterTaskLoopSimdDirective::classof(), clang::UnresolvedMemberExpr::classof(), clang::OMPDistributeDirective::classof(), clang::CXXNoexceptExpr::classof(), clang::OMPTargetUpdateDirective::classof(), clang::PackExpansionExpr::classof(), clang::AbstractConditionalOperator::classof(), clang::OMPDistributeParallelForDirective::classof(), clang::ConditionalOperator::classof(), clang::OMPDistributeParallelForSimdDirective::classof(), clang::SizeOfPackExpr::classof(), clang::OMPDistributeSimdDirective::classof(), clang::BinaryConditionalOperator::classof(), clang::AddrLabelExpr::classof(), clang::OMPTargetParallelForSimdDirective::classof(), clang::SubstNonTypeTemplateParmPackExpr::classof(), clang::StmtExpr::classof(), clang::OMPTargetSimdDirective::classof(), clang::ShuffleVectorExpr::classof(), clang::FunctionParmPackExpr::classof(), clang::OMPTeamsDistributeDirective::classof(), clang::ConvertVectorExpr::classof(), clang::OMPTeamsDistributeSimdDirective::classof(), clang::MaterializeTemporaryExpr::classof(), clang::ChooseExpr::classof(), clang::OMPTeamsDistributeParallelForSimdDirective::classof(), clang::GNUNullExpr::classof(), clang::CXXFoldExpr::classof(), clang::VAArgExpr::classof(), clang::OMPTeamsDistributeParallelForDirective::classof(), clang::SourceLocExpr::classof(), clang::OMPTargetTeamsDirective::classof(), clang::CoroutineSuspendExpr::classof(), clang::CoawaitExpr::classof(), clang::OMPTargetTeamsDistributeDirective::classof(), clang::DependentCoawaitExpr::classof(), clang::CoyieldExpr::classof(), clang::BuiltinBitCastExpr::classof(), clang::OMPTargetTeamsDistributeParallelForDirective::classof(), clang::OMPTargetTeamsDistributeParallelForSimdDirective::classof(), clang::OMPTargetTeamsDistributeSimdDirective::classof(), clang::OMPTileDirective::classof(), clang::OMPUnrollDirective::classof(), clang::OMPScanDirective::classof(), clang::OMPInteropDirective::classof(), clang::NoInitExpr::classof(), clang::OMPDispatchDirective::classof(), clang::OMPMaskedDirective::classof(), clang::OMPMetaDirective::classof(), clang::ImplicitValueInitExpr::classof(), clang::ParenListExpr::classof(), clang::GenericSelectionExpr::classof(), clang::ExtVectorElementExpr::classof(), clang::BlockExpr::classof(), clang::AsTypeExpr::classof(), clang::PseudoObjectExpr::classof(), clang::AtomicExpr::classof(), clang::TypoExpr::classof(), clang::RecoveryExpr::classof(), clang::computeDependence(), clang::CodeGen::CodeGenFunction::EmitLValue(), FindTypeTagExpr(), getBaseAlignmentAndOffsetFromLValue(), getBaseAlignmentAndOffsetFromPtr(), getBeginLoc(), clang::CXXNamedCastExpr::getCastName(), clang::ento::SValBuilder::getConstantVal(), getEndLoc(), clang::Expr::getExprLoc(), getLoopCondition(), getPrimaryDecl(), clang::threadSafety::getSourceLiteralString(), getSourceRange(), clang::CastExpr::getTrailingFPFeatures(), clang::Expr::HasSideEffects(), ignoreTransparentExprs(), clang::Expr::isConstantInitializer(), IsGlobalLValue(), isIdenticalStmt(), isLoop(), clang::Expr::isOBJCGCCandidate(), isObjCObjectLiteral(), clang::Expr::isSameComparisonOperand(), clang::Expr::isUnusedResultAWarning(), requiresParensToAddCast(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), clang::TreeTransform< Derived >::TransformExpr(), clang::ASTNodeImporter::VisitExplicitCastExpr(), clang::ento::ConditionBRVisitor::VisitTerminator(), and clang::ento::ConditionBRVisitor::VisitTrueTest().

◆ getStmtClassName()

const char * Stmt::getStmtClassName ( ) const

Definition at line 77 of file Stmt.cpp.

References getStmtInfoTableEntry(), StmtClassNameTable::Name, and StmtBits.

Referenced by clang::ASTNodeImporter::VisitExpr().

◆ 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 1231 of file Stmt.h.

References IgnoreContainers().

◆ operator delete() [1/5]

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

Definition at line 1094 of file Stmt.h.

◆ operator delete() [2/5]

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

Definition at line 1095 of file Stmt.h.

◆ operator delete() [3/5]

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

Definition at line 1096 of file Stmt.h.

◆ operator delete() [4/5]

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

Definition at line 1097 of file Stmt.h.

◆ operator delete() [5/5]

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

Definition at line 91 of file Stmt.h.

◆ operator new() [1/4]

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

Definition at line 87 of file Stmt.h.

◆ operator new() [2/4]

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

Definition at line 72 of file Stmt.cpp.

References bytes().

◆ operator new() [3/4]

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

Definition at line 1087 of file Stmt.h.

References bytes().

◆ operator new() [4/4]

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

Definition at line 1092 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 2596 of file StmtPrinter.cpp.

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

◆ printPretty()

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

◆ PrintStats()

void Stmt::PrintStats ( )
static

Definition at line 99 of file Stmt.cpp.

References getStmtInfoTableEntry(), and StmtClassInfo.

◆ 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 2293 of file StmtProfile.cpp.

◆ Profile()

void Stmt::Profile ( llvm::FoldingSetNodeID &  ID,
const ASTContext Context,
bool  Canonical 
) 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.

Definition at line 2287 of file StmtProfile.cpp.

Referenced by clang::Sema::ActOnOpenMPAtomicDirective(), checkDeducedTemplateArguments(), clang::Sema::IsOverload(), isSameEntity(), isSameTemplateArg(), isSameTemplateParameterList(), clang::Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), clang::DependentSizedMatrixType::Profile(), clang::DependentTypeOfExprType::Profile(), clang::DependentDecltypeType::Profile(), ProfileTemplateParameterList(), and clang::Sema::TemplateParameterListsAreEqual().

◆ stripLabelLikeStatements() [1/2]

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

Definition at line 1236 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 217 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 84 of file Stmt.h.

◆ ASTStmtWriter

friend class ASTStmtWriter
friend

Definition at line 85 of file Stmt.h.

Member Data Documentation

◆ @79

union { ... }

◆ ArrayOrMatrixSubscriptExprBits

ArrayOrMatrixSubscriptExprBitfields clang::Stmt::ArrayOrMatrixSubscriptExprBits

◆ AttributedStmtBits

AttributedStmtBitfields clang::Stmt::AttributedStmtBits

Definition at line 1009 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 1017 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

Definition at line 1052 of file Stmt.h.

Referenced by clang::CXXDefaultArgExpr::getUsedLocation().

◆ 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 1046 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 1061 of file Stmt.h.

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

◆ DeclRefExprBits

DeclRefExprBitfields clang::Stmt::DeclRefExprBits

◆ DependentScopeDeclRefExprBits

DependentScopeDeclRefExprBitfields clang::Stmt::DependentScopeDeclRefExprBits

Definition at line 1058 of file Stmt.h.

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

◆ DoStmtBits

DoStmtBitfields clang::Stmt::DoStmtBits

Definition at line 1013 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 1038 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 1008 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 1075 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 1037 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 1018 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 1005 of file Stmt.h.

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

◆ StmtExprBits

StmtExprBitfields clang::Stmt::StmtExprBits

Definition at line 1043 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

◆ UnresolvedMemberExprBits

UnresolvedMemberExprBitfields clang::Stmt::UnresolvedMemberExprBits

◆ WhileStmtBits

WhileStmtBitfields clang::Stmt::WhileStmtBits

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