clang  6.0.0svn
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  CallExprBitfields
 
class  CastExprBitfields
 
class  CharacterLiteralBitfields
 
class  CoawaitExprBitfields
 
class  CompoundStmtBitfields
 
struct  ConstExprIterator
 Const iterator for iterating over Stmt * arrays that contain only Expr *. More...
 
class  DeclRefExprBitfields
 
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
 
struct  ExprIterator
 Iterator for iterating over Stmt * arrays that contain only Expr *. More...
 
class  ExprWithCleanupsBitfields
 
class  FloatingLiteralBitfields
 
class  IfStmtBitfields
 
class  InitListExprBitfields
 
class  ObjCIndirectCopyRestoreExprBitfields
 
class  PseudoObjectExprBitfields
 
class  StmtBitfields
 
class  TypeTraitExprBitfields
 
class  UnaryExprOrTypeTraitExprBitfields
 

Public Types

enum  StmtClass { NoStmtClass = 0 }
 
typedef StmtIterator child_iterator
 Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatements/subexpessions of an AST node. More...
 
typedef ConstStmtIterator const_child_iterator
 
typedef llvm::iterator_range< child_iteratorchild_range
 
typedef llvm::iterator_range< const_child_iteratorconst_child_range
 

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 (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 getLocStart () const LLVM_READONLY
 
SourceLocation getLocEnd () const LLVM_READONLY
 
void dump () const
 Dumps the specified AST fragment and all subtrees to llvm::errs(). More...
 
void dump (SourceManager &SM) const
 
void dump (raw_ostream &OS, SourceManager &SM) const
 
void dump (raw_ostream &OS) 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, const ASTContext *Context=nullptr) const
 
void viewAST () const
 viewAST - Visualize an AST rooted at this Stmt* using GraphViz. More...
 
StmtIgnoreImplicit ()
 Skip past any implicit AST nodes which might surround this statement, such as ExprWithCleanups or ImplicitCastExpr nodes. More...
 
const StmtIgnoreImplicit () const
 
StmtIgnoreContainers (bool IgnoreCaptured=false)
 Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true. More...
 
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 ()
 

Protected Types

enum  { NumStmtBits = 8 }
 
enum  { NumExprBits = 17 }
 
enum  APFloatSemantics {
  IEEEhalf, IEEEsingle, IEEEdouble, x87DoubleExtended,
  IEEEquad, PPCDoubleDouble
}
 

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
 
   CompoundStmtBitfields   CompoundStmtBits
 
   IfStmtBitfields   IfStmtBits
 
   ExprBitfields   ExprBits
 
   CharacterLiteralBitfields   CharacterLiteralBits
 
   FloatingLiteralBitfields   FloatingLiteralBits
 
   UnaryExprOrTypeTraitExprBitfields   UnaryExprOrTypeTraitExprBits
 
   DeclRefExprBitfields   DeclRefExprBits
 
   CastExprBitfields   CastExprBits
 
   CallExprBitfields   CallExprBits
 
   ExprWithCleanupsBitfields   ExprWithCleanupsBits
 
   PseudoObjectExprBitfields   PseudoObjectExprBits
 
   ObjCIndirectCopyRestoreExprBitfields   ObjCIndirectCopyRestoreExprBits
 
   InitListExprBitfields   InitListExprBits
 
   TypeTraitExprBitfields   TypeTraitExprBits
 
   CoawaitExprBitfields   CoawaitBits
 
}; 
 

Friends

class ASTStmtReader
 
class ASTStmtWriter
 

Detailed Description

Stmt - This represents one statement.

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

◆ child_range

typedef llvm::iterator_range<child_iterator> clang::Stmt::child_range

Definition at line 422 of file Stmt.h.

◆ const_child_iterator

Definition at line 420 of file Stmt.h.

◆ const_child_range

Definition at line 423 of file Stmt.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
NumStmtBits 

Definition at line 88 of file Stmt.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumExprBits 

Definition at line 136 of file Stmt.h.

◆ APFloatSemantics

Enumerator
IEEEhalf 
IEEEsingle 
IEEEdouble 
x87DoubleExtended 
IEEEquad 
PPCDoubleDouble 

Definition at line 145 of file Stmt.h.

◆ StmtClass

Enumerator
NoStmtClass 

Definition at line 62 of file Stmt.h.

Constructor & Destructor Documentation

◆ Stmt() [1/2]

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

◆ Stmt() [2/2]

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

Definition at line 352 of file Stmt.h.

Member Function Documentation

◆ addStmtClass()

void Stmt::addStmtClass ( const StmtClass  s)
static

Definition at line 87 of file Stmt.cpp.

References StmtClassNameTable::Counter, and getStmtInfoTableEntry().

◆ child_begin() [1/2]

child_iterator clang::Stmt::child_begin ( )
inline

Definition at line 431 of file Stmt.h.

References clang::children().

Referenced by llvm::GraphTraits< clang::Stmt * >::child_begin(), llvm::GraphTraits< const clang::Stmt * >::child_begin(), clang::OMPExecutableDirective::getAssociatedStmt(), clang::OMPLoopDirective::getCalcLastIteration(), clang::OMPLoopDirective::getCombinedCond(), clang::OMPLoopDirective::getCombinedEnsureUpperBound(), clang::OMPLoopDirective::getCombinedInit(), clang::OMPLoopDirective::getCombinedLowerBoundVariable(), clang::OMPLoopDirective::getCombinedNextLowerBound(), clang::OMPLoopDirective::getCombinedNextUpperBound(), clang::OMPLoopDirective::getCombinedUpperBoundVariable(), clang::OMPLoopDirective::getCond(), clang::OMPLoopDirective::getDistInc(), clang::OMPLoopDirective::getEnsureUpperBound(), clang::OMPAtomicDirective::getExpr(), clang::DesignatedInitExpr::Designator::getFieldName(), clang::OMPLoopDirective::getInc(), clang::OMPLoopDirective::getInit(), clang::OMPLoopDirective::getIsLastIterVariable(), clang::OMPLoopDirective::getIterationVariable(), clang::OMPLoopDirective::getLastIteration(), clang::OMPLoopDirective::getLowerBoundVariable(), clang::OMPLoopDirective::getNextLowerBound(), clang::OMPLoopDirective::getNextUpperBound(), clang::OMPLoopDirective::getNumIterations(), clang::OMPLoopDirective::getPreCond(), clang::OMPLoopDirective::getPreInits(), clang::OMPLoopDirective::getPrevEnsureUpperBound(), clang::OMPLoopDirective::getPrevLowerBoundVariable(), clang::OMPLoopDirective::getPrevUpperBoundVariable(), clang::OMPTaskgroupDirective::getReductionRef(), clang::OMPLoopDirective::getStrideVariable(), clang::OMPAtomicDirective::getUpdateExpr(), clang::OMPLoopDirective::getUpperBoundVariable(), clang::OMPAtomicDirective::getV(), clang::OMPAtomicDirective::getX(), isIdenticalStmt(), clang::OMPLoopDirective::setCalcLastIteration(), clang::OMPLoopDirective::setCombinedCond(), clang::OMPLoopDirective::setCombinedEnsureUpperBound(), clang::OMPLoopDirective::setCombinedInit(), clang::OMPLoopDirective::setCombinedLowerBoundVariable(), clang::OMPLoopDirective::setCombinedNextLowerBound(), clang::OMPLoopDirective::setCombinedNextUpperBound(), clang::OMPLoopDirective::setCombinedUpperBoundVariable(), clang::OMPLoopDirective::setCond(), clang::OMPLoopDirective::setDistInc(), clang::OMPLoopDirective::setEnsureUpperBound(), clang::OMPLoopDirective::setInc(), clang::OMPLoopDirective::setInit(), clang::OMPLoopDirective::setIsLastIterVariable(), clang::OMPLoopDirective::setIterationVariable(), clang::OMPLoopDirective::setLastIteration(), clang::OMPLoopDirective::setLowerBoundVariable(), clang::OMPLoopDirective::setNextLowerBound(), clang::OMPLoopDirective::setNextUpperBound(), clang::OMPLoopDirective::setNumIterations(), clang::OMPLoopDirective::setPreCond(), clang::OMPLoopDirective::setPreInits(), clang::OMPLoopDirective::setPrevEnsureUpperBound(), clang::OMPLoopDirective::setPrevLowerBoundVariable(), clang::OMPLoopDirective::setPrevUpperBoundVariable(), clang::OMPLoopDirective::setStrideVariable(), and clang::OMPLoopDirective::setUpperBoundVariable().

◆ child_begin() [2/2]

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

Definition at line 434 of file Stmt.h.

References clang::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 435 of file Stmt.h.

References clang::children().

◆ children() [1/2]

Stmt::child_range Stmt::children ( )

◆ children() [2/2]

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

Definition at line 426 of file Stmt.h.

References clang::children().

◆ dump() [1/4]

LLVM_DUMP_METHOD void Stmt::dump ( ) const

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

Definition at line 2732 of file ASTDumper.cpp.

References P.

Referenced by clang::ento::PathDiagnosticLocation::dump().

◆ dump() [2/4]

LLVM_DUMP_METHOD void Stmt::dump ( SourceManager SM) const

Definition at line 2718 of file ASTDumper.cpp.

References dump().

◆ dump() [3/4]

LLVM_DUMP_METHOD void Stmt::dump ( raw_ostream &  OS,
SourceManager SM 
) const

Definition at line 2722 of file ASTDumper.cpp.

References P.

◆ dump() [4/4]

LLVM_DUMP_METHOD void Stmt::dump ( raw_ostream &  OS) const

Definition at line 2727 of file ASTDumper.cpp.

References P.

◆ dumpColor()

LLVM_DUMP_METHOD void Stmt::dumpColor ( ) const

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

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

References clang::ASTContext::getLangOpts().

◆ EnableStatistics()

void Stmt::EnableStatistics ( )
static

Definition at line 92 of file Stmt.cpp.

◆ getLocEnd()

SourceLocation Stmt::getLocEnd ( ) const

Definition at line 270 of file Stmt.cpp.

References NoStmtClass.

Referenced by clang::Sema::ActOnLambdaExpr(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), clang::Sema::BuildCStyleCastExpr(), clang::Sema::BuildCXXFunctionalCastExpr(), CheckFallThroughForBody(), clang::Sema::CheckObjCBridgeRelatedConversions(), clang::Sema::CreateBuiltinBinOp(), clang::InitializationKind::CreateForInit(), CreateIfFixit(), clang::CXXDestructorCall::CXXDestructorCall(), clang::InitializationSequence::Diagnose(), DiagnoseBitwisePrecedence(), clang::Sema::DiagnoseCommaOperator(), DiagnoseConditionalPrecedence(), DiagnoseNarrowingInInitList(), diagnoseNoViableConversion(), DiagnoseShiftCompare(), diagnoseStringPlusChar(), diagnoseStringPlusInt(), clang::CodeGen::CodeGenFunction::GenerateSEHFinallyFunction(), clang::StmtSequence::getEndLoc(), clang::SEHFinallyStmt::getEndLoc(), clang::SEHTryStmt::getEndLoc(), clang::CXXCatchStmt::getLocEnd(), clang::ObjCStringLiteral::getLocEnd(), clang::ObjCForCollectionStmt::getLocEnd(), clang::ObjCAtCatchStmt::getLocEnd(), clang::ObjCAtFinallyStmt::getLocEnd(), clang::CXXForRangeStmt::getLocEnd(), clang::MSDependentExistsStmt::getLocEnd(), clang::ObjCAtThrowStmt::getLocEnd(), clang::ObjCAutoreleasePoolStmt::getLocEnd(), clang::CXXStdInitializerListExpr::getLocEnd(), clang::CaseStmt::getLocEnd(), clang::DefaultStmt::getLocEnd(), clang::LabelStmt::getLocEnd(), clang::AttributedStmt::getLocEnd(), clang::OpaqueValueExpr::getLocEnd(), clang::IfStmt::getLocEnd(), clang::SwitchStmt::getLocEnd(), clang::WhileStmt::getLocEnd(), clang::CXXBindTemporaryExpr::getLocEnd(), clang::ForStmt::getLocEnd(), clang::IndirectGotoStmt::getLocEnd(), clang::CXXConstructExpr::getLocEnd(), clang::ReturnStmt::getLocEnd(), clang::ImaginaryLiteral::getLocEnd(), clang::ObjCIndirectCopyRestoreExpr::getLocEnd(), clang::UnaryOperator::getLocEnd(), clang::CXXDeleteExpr::getLocEnd(), clang::CompoundLiteralExpr::getLocEnd(), clang::ExprWithCleanups::getLocEnd(), clang::CXXUnresolvedConstructExpr::getLocEnd(), clang::DesignatedInitUpdateExpr::getLocEnd(), clang::BlockExpr::getLocEnd(), clang::FieldDecl::getSourceRange(), clang::Expr::isUnusedResultAWarning(), clang::ento::ConditionBRVisitor::patternMatch(), rewriteToDictionaryLiteral(), clang::consumed::ConsumedAnalyzer::run(), scanToNextArgument(), clang::Sema::SemaBuiltinShuffleVector(), and clang::FunctionDecl::setBody().

◆ getLocStart()

SourceLocation Stmt::getLocStart ( ) const

Definition at line 257 of file Stmt.cpp.

References NoStmtClass.

Referenced by clang::Sema::ActOnCallExpr(), clang::Sema::ActOnFinishCXXInClassMemberInitializer(), clang::Sema::ActOnOpenMPDistScheduleClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPParallelSectionsDirective(), clang::Sema::ActOnOpenMPScheduleClause(), clang::Sema::ActOnOpenMPSectionsDirective(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), buildCaptureDecl(), clang::Sema::BuildInstanceMessage(), BuildNonArrayForRange(), clang::Sema::BuildOverloadedCallExpr(), clang::Sema::buildOverloadedCallSet(), clang::Sema::CanPerformCopyInitialization(), CastForMoving(), CheckArrayDesignatorExpr(), checkConditionalVoidType(), clang::Sema::CheckConstexprFunctionBody(), CheckConstexprFunctionStmt(), CheckConvertedConstantExpression(), clang::Sema::checkDeclIsAllowedInOpenMPTarget(), checkDirectCallValidity(), CheckEvalInICE(), CheckFallThroughForBody(), CheckICE(), clang::Sema::CheckImplementationIvars(), CheckMoveOnConstruction(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), clang::Sema::CheckObjCBridgeRelatedCast(), clang::Sema::CheckObjCBridgeRelatedConversions(), CheckObjCCollectionLiteralElement(), clang::Sema::checkOpenCLDisabledDecl(), checkOpenCLEnqueueIntType(), checkOpenCLPipeArg(), checkRecursiveFunction(), CheckReturnStackAddr(), clang::Sema::checkStringLiteralArgumentAttr(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), checkVAStartABI(), checkVAStartIsInVariadicFunction(), clang::Sema::CreateBuiltinBinOp(), clang::InitializationKind::CreateForInit(), CreateIfFixit(), clang::Sema::DeduceAutoType(), DiagnoseBitwisePrecedence(), clang::Sema::DiagnoseCommaOperator(), DiagnoseConditionalPrecedence(), clang::Sema::DiagnoseEmptyLoopBody(), diagnoseLogicalNotOnLHSofCheck(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), DiagnoseNarrowingInInitList(), diagnoseNoViableConversion(), DiagnoseShiftCompare(), diagnoseStringPlusChar(), diagnoseStringPlusInt(), DiagnoseSwitchLabelsFallthrough(), DiagUninitUse(), evaluateVarDeclInit(), FinishOverloadedCallExpr(), clang::Sema::GatherArgumentsForCall(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), getInitializationLoc(), clang::OMPArraySectionExpr::getLocStart(), clang::UserDefinedLiteral::getLocStart(), clang::CXXStdInitializerListExpr::getLocStart(), clang::MSPropertyRefExpr::getLocStart(), clang::ObjCSubscriptRefExpr::getLocStart(), clang::OpaqueValueExpr::getLocStart(), clang::CXXBindTemporaryExpr::getLocStart(), clang::CXXConstructExpr::getLocStart(), clang::ImaginaryLiteral::getLocStart(), clang::ObjCIndirectCopyRestoreExpr::getLocStart(), clang::UnaryOperator::getLocStart(), clang::CXXPseudoDestructorExpr::getLocStart(), clang::CallExpr::getLocStart(), clang::CompoundLiteralExpr::getLocStart(), clang::ExprWithCleanups::getLocStart(), clang::CXXDependentScopeMemberExpr::getLocStart(), clang::UnresolvedMemberExpr::getLocStart(), clang::PackExpansionExpr::getLocStart(), clang::DesignatedInitUpdateExpr::getLocStart(), clang::StmtSequence::getStartLoc(), getStrlenExprArg(), clang::Sema::InstantiateInClassInitializer(), clang::AnalysisDeclContext::isBodyAutosynthesizedFromModelFile(), IsInitializerListConstructorConversion(), clang::Expr::isUnusedResultAWarning(), IsUserDefinedConversion(), isValidOrderingForOp(), LookThroughTransitiveAssignmentsAndCommaOperators(), LookupMethodInReceiverType(), clang::ento::ConditionBRVisitor::patternMatch(), clang::InitializationSequence::Perform(), clang::Sema::PerformCopyInitialization(), clang::ento::ExprEngine::processBranch(), clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr(), rewriteToArrayLiteral(), rewriteToDictionaryLiteral(), scanToNextArgument(), clang::Sema::SemaBuiltinShuffleVector(), SemaOpenCLBuiltinEnqueueKernel(), clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), TryClassUnification(), TryCopyInitialization(), TryImplicitConversion(), TryLValueToRValueCast(), TryReferenceInitializationCore(), TryReferenceListInitialization(), TryRefInitWithConversionFunction(), TryUserDefinedConversion(), clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode(), warnBracedScalarInit(), and Write_RethrowObject().

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

References NoStmtClass.

Referenced by clang::Sema::ActOnCXXFoldExpr(), clang::Sema::ActOnDependentMemberExpr(), clang::Sema::ActOnDesignatedInitializer(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnObjCAtSynchronizedOperand(), clang::Sema::ActOnOpenMPAtomicDirective(), clang::Sema::ActOnOpenMPIsDevicePtrClause(), clang::Sema::ActOnOpenMPThreadprivateDirective(), clang::Sema::ActOnParamDefaultArgument(), clang::Sema::ActOnStartCXXMemberReference(), clang::Sema::ActOnStartLinkageSpecification(), addFixitForObjCARCConversion(), clang::Sema::AddInitializerToDecl(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildDelegatingInitializer(), clang::Sema::BuildInstanceMessage(), clang::Sema::BuildMemberInitializer(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildObjCAtThrowStmt(), clang::Sema::BuildObjCBridgedCast(), clang::Sema::BuildPseudoDestructorExpr(), clang::Sema::BuildReturnStmt(), clang::Sema::BuildStaticAssertDeclaration(), CastForMoving(), checkArithmeticBinOpPointerOperands(), checkArithmeticIncompletePointerType(), CheckArrayDesignatorExpr(), checkBuiltinArgument(), checkCondition(), checkConditionalVoidType(), CheckConvertedConstantExpression(), CheckCXX98CompatAccessibleCopy(), clang::Sema::checkDeclIsAllowedInOpenMPTarget(), checkEnumComparison(), clang::Sema::CheckExceptionSpecCompatibility(), clang::Sema::CheckExtraCXXDefaultArguments(), CheckForDanglingReferenceOrPointer(), CheckFormatString(), CheckIncrementDecrementOperand(), checkIndirectCopyRestoreSource(), CheckIndirectionOperand(), CheckKeyForObjCARCConversion(), CheckMapClauseExpressionBase(), CheckMapConflicts(), CheckNonNullArgument(), CheckObjCCollectionLiteralElement(), clang::Sema::CheckObjCForCollectionOperand(), checkObjCPointerIntrospection(), checkOpenCLConditionVector(), checkOpenCLPipeArg(), checkOpenCLPipePacketType(), CheckOpenMPLoop(), clang::Sema::CheckPackExpansion(), checkPointerIntegerMismatch(), CheckReturnStackAddr(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), checkUnsafeAssignLiteral(), checkUnsafeAssignObject(), clang::Sema::checkUnsafeExprAssigns(), checkVAStartIsInVariadicFunction(), CopyObject(), CreateIfFixit(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), clang::Sema::DiagnoseAlwaysNonNullPointer(), diagnoseAmbiguousConversion(), diagnoseArithmeticOnFunctionPointer(), diagnoseArithmeticOnNullPointer(), diagnoseArithmeticOnTwoFunctionPointers(), diagnoseArithmeticOnTwoVoidPointers(), diagnoseArithmeticOnVoidPointer(), clang::Sema::DiagnoseAutoDeductionFailure(), clang::Sema::DiagnoseCommaOperator(), DiagnoseConditionalPrecedence(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), DiagnoseNarrowingInInitList(), diagnoseObjCARCConversion(), diagnoseObjCLiteralComparison(), diagnosePointerIncompatibility(), diagnoseRetainCycle(), DiagnoseSelfAssignment(), clang::Sema::DiagnoseSelfMove(), DiagnoseShiftCompare(), DiagUninitUse(), doRewriteToUTF8StringBoxedExpressionHelper(), emitBug(), EmitDiagnosticForLogicalAndInLogicalOr(), clang::CodeGen::CodeGenFunction::emitImplicitAssignmentOperatorBody(), clang::CodeGen::CGOpenMPRuntime::emitOMPIfClause(), clang::CodeGen::CodeGenFunction::EmitOMPInnerLoop(), EvaluateArrayTypeTrait(), findRetainCycleOwner(), finishContextualImplicitConversion(), FinishOverloadedCallExpr(), clang::ento::CallEvent::getArgSourceRange(), getAsPointeeSymbol(), GetCFNumberSize(), clang::Sema::GetFormatStringType(), getIncrementedVar(), getLengthOnSingleLine(), GetNSSetArgumentIndex(), clang::Sema::getPrintable(), getPrintfFormatArgumentNum(), getPrivateItem(), getReturnTypeForMethod(), getSizeOfArgType(), clang::CXXStdInitializerListExpr::getSourceRange(), clang::ObjCMethodCall::getSourceRange(), getStrlenExprArg(), HandleAddressSpaceTypeAttribute(), clang::Sema::HandleExprPropertyRefExpr(), HandleNeonVectorTypeAttr(), HandleVectorSizeAttr(), clang::Sema::InvalidLogicalVectorOperands(), isArrayIndexOutOfBounds(), isDebuggingContext(), IsNonNegativeIntegerValue(), isNullPointerValueTemplateArgument(), clang::Expr::isUnusedResultAWarning(), isValidOrderingForOp(), LookThroughTransitiveAssignmentsAndCommaOperators(), LookupMemberExprInRecord(), LookupMethodInReceiverType(), maybePutParensOnReceiver(), objectifyExpr(), clang::InitializationSequence::Perform(), clang::Sema::PerformContextualImplicitConversion(), printExprAsWritten(), recordConversion(), clang::tooling::replaceStmtWithStmt(), clang::tooling::replaceStmtWithText(), clang::edit::rewriteObjCRedundantCallWithLiteral(), rewriteToArrayLiteral(), rewriteToArraySubscriptSet(), rewriteToBoolLiteral(), rewriteToCharLiteral(), rewriteToDictionaryLiteral(), rewriteToDictionarySubscriptSet(), rewriteToNumberLiteral(), rewriteToNumericBoxedExpression(), rewriteToSubscriptGetCommon(), SemaBuiltinCommitRWPipe(), SemaBuiltinCpuIs(), SemaBuiltinCpuSupports(), SemaBuiltinPipePackets(), SemaBuiltinReserveRWPipe(), SemaBuiltinRWPipe(), clang::Sema::SemaBuiltinShuffleVector(), clang::Sema::SemaConvertVectorExpr(), SemaOpenCLBuiltinToAddr(), clang::Sema::VerifyBitField(), warnBracedScalarInit(), and warnOnLifetimeExtension().

◆ getStmtClass()

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

Definition at line 361 of file Stmt.h.

References dump(), clang::tooling::fixit::internal::getSourceRange(), and SM.

Referenced by AddVariableConstraints(), clang::CFG::BuildOptions::alwaysAdd(), CheckConstexprFunctionStmt(), checkFormatStringExpr(), CheckICE(), clang::Sema::CheckLiteralKind(), clang::ObjCStringLiteral::classof(), clang::CXXCatchStmt::classof(), clang::ObjCForCollectionStmt::classof(), clang::ObjCBoolLiteralExpr::classof(), clang::CXXOperatorCallExpr::classof(), clang::CXXTryStmt::classof(), clang::ObjCAtCatchStmt::classof(), clang::OMPArraySectionExpr::classof(), clang::ObjCBoxedExpr::classof(), clang::ObjCAtFinallyStmt::classof(), clang::CXXMemberCallExpr::classof(), clang::ObjCArrayLiteral::classof(), clang::CXXForRangeStmt::classof(), clang::CUDAKernelCallExpr::classof(), clang::ObjCAtTryStmt::classof(), clang::CXXNamedCastExpr::classof(), clang::MSDependentExistsStmt::classof(), clang::CXXStaticCastExpr::classof(), clang::ObjCAtSynchronizedStmt::classof(), clang::OMPParallelDirective::classof(), clang::ObjCDictionaryLiteral::classof(), clang::CXXDynamicCastExpr::classof(), clang::ObjCAtThrowStmt::classof(), clang::ObjCAutoreleasePoolStmt::classof(), clang::CXXReinterpretCastExpr::classof(), clang::ObjCEncodeExpr::classof(), clang::CXXConstCastExpr::classof(), clang::CoroutineBodyStmt::classof(), clang::ObjCSelectorExpr::classof(), clang::ObjCProtocolExpr::classof(), clang::CoreturnStmt::classof(), clang::DeclStmt::classof(), clang::CXXBoolLiteralExpr::classof(), clang::ObjCIvarRefExpr::classof(), clang::CXXNullPtrLiteralExpr::classof(), clang::NullStmt::classof(), clang::CompoundStmt::classof(), clang::CXXTypeidExpr::classof(), clang::SwitchCase::classof(), clang::ObjCPropertyRefExpr::classof(), clang::MSPropertyRefExpr::classof(), clang::CaseStmt::classof(), clang::MSPropertySubscriptExpr::classof(), clang::DefaultStmt::classof(), clang::ObjCSubscriptRefExpr::classof(), clang::LabelStmt::classof(), clang::Expr::classof(), clang::CXXUuidofExpr::classof(), clang::AttributedStmt::classof(), clang::CXXThisExpr::classof(), clang::OpaqueValueExpr::classof(), clang::OMPLoopDirective::classof(), clang::CXXThrowExpr::classof(), clang::IfStmt::classof(), clang::OMPSimdDirective::classof(), clang::CXXDefaultArgExpr::classof(), clang::SwitchStmt::classof(), clang::CXXDefaultInitExpr::classof(), clang::OMPForDirective::classof(), clang::WhileStmt::classof(), clang::DoStmt::classof(), clang::OMPForSimdDirective::classof(), clang::CXXBindTemporaryExpr::classof(), clang::DeclRefExpr::classof(), clang::PredefinedExpr::classof(), clang::OMPSectionsDirective::classof(), clang::ForStmt::classof(), clang::GotoStmt::classof(), clang::OMPSectionDirective::classof(), clang::IndirectGotoStmt::classof(), clang::CXXConstructExpr::classof(), clang::IntegerLiteral::classof(), clang::ContinueStmt::classof(), clang::ObjCMessageExpr::classof(), clang::OMPSingleDirective::classof(), clang::BreakStmt::classof(), clang::CharacterLiteral::classof(), clang::CXXInheritedCtorInitExpr::classof(), clang::OMPMasterDirective::classof(), clang::ReturnStmt::classof(), clang::ObjCIsaExpr::classof(), clang::FloatingLiteral::classof(), clang::CXXFunctionalCastExpr::classof(), clang::OMPCriticalDirective::classof(), clang::ImaginaryLiteral::classof(), clang::CXXTemporaryObjectExpr::classof(), clang::ObjCIndirectCopyRestoreExpr::classof(), clang::AsmStmt::classof(), clang::OMPParallelForDirective::classof(), clang::ObjCBridgedCastExpr::classof(), clang::ObjCAvailabilityCheckExpr::classof(), clang::OMPParallelForSimdDirective::classof(), clang::StringLiteral::classof(), clang::OMPParallelSectionsDirective::classof(), clang::ParenExpr::classof(), clang::LambdaExpr::classof(), clang::OMPTaskDirective::classof(), clang::GCCAsmStmt::classof(), clang::CXXScalarValueInitExpr::classof(), clang::OMPTaskyieldDirective::classof(), clang::UnaryOperator::classof(), clang::OMPBarrierDirective::classof(), clang::MSAsmStmt::classof(), clang::OMPTaskwaitDirective::classof(), clang::SEHExceptStmt::classof(), clang::SEHFinallyStmt::classof(), clang::OMPTaskgroupDirective::classof(), clang::CXXNewExpr::classof(), clang::SEHTryStmt::classof(), clang::OffsetOfExpr::classof(), clang::SEHLeaveStmt::classof(), clang::OMPFlushDirective::classof(), clang::CXXDeleteExpr::classof(), clang::OMPOrderedDirective::classof(), clang::UnaryExprOrTypeTraitExpr::classof(), clang::ArraySubscriptExpr::classof(), clang::OMPAtomicDirective::classof(), clang::CapturedStmt::classof(), clang::CXXPseudoDestructorExpr::classof(), clang::OMPTargetDirective::classof(), clang::TypeTraitExpr::classof(), clang::OMPTargetDataDirective::classof(), clang::CallExpr::classof(), clang::OMPTargetEnterDataDirective::classof(), clang::ArrayTypeTraitExpr::classof(), clang::OMPTargetExitDataDirective::classof(), clang::ExpressionTraitExpr::classof(), clang::OMPTargetParallelDirective::classof(), clang::OMPTargetParallelForDirective::classof(), clang::MemberExpr::classof(), clang::OverloadExpr::classof(), clang::OMPTeamsDirective::classof(), clang::CompoundLiteralExpr::classof(), clang::OMPCancellationPointDirective::classof(), clang::UnresolvedLookupExpr::classof(), clang::OMPCancelDirective::classof(), clang::CastExpr::classof(), clang::OMPTaskLoopDirective::classof(), clang::ImplicitCastExpr::classof(), clang::OMPTaskLoopSimdDirective::classof(), clang::DependentScopeDeclRefExpr::classof(), clang::ExplicitCastExpr::classof(), clang::CStyleCastExpr::classof(), clang::OMPDistributeDirective::classof(), clang::ExprWithCleanups::classof(), clang::OMPTargetUpdateDirective::classof(), clang::OMPDistributeParallelForDirective::classof(), clang::CXXUnresolvedConstructExpr::classof(), clang::OMPDistributeParallelForSimdDirective::classof(), clang::OMPDistributeSimdDirective::classof(), clang::AbstractConditionalOperator::classof(), clang::OMPTargetParallelForSimdDirective::classof(), clang::ConditionalOperator::classof(), clang::CXXDependentScopeMemberExpr::classof(), clang::OMPTargetSimdDirective::classof(), clang::BinaryConditionalOperator::classof(), clang::OMPTeamsDistributeDirective::classof(), clang::AddrLabelExpr::classof(), clang::UnresolvedMemberExpr::classof(), clang::OMPTeamsDistributeSimdDirective::classof(), clang::StmtExpr::classof(), clang::CXXNoexceptExpr::classof(), clang::ShuffleVectorExpr::classof(), clang::OMPTeamsDistributeParallelForSimdDirective::classof(), clang::PackExpansionExpr::classof(), clang::OMPTeamsDistributeParallelForDirective::classof(), clang::ConvertVectorExpr::classof(), clang::OMPTargetTeamsDirective::classof(), clang::ChooseExpr::classof(), clang::SizeOfPackExpr::classof(), clang::GNUNullExpr::classof(), clang::OMPTargetTeamsDistributeDirective::classof(), clang::SubstNonTypeTemplateParmExpr::classof(), clang::VAArgExpr::classof(), clang::OMPTargetTeamsDistributeParallelForDirective::classof(), clang::SubstNonTypeTemplateParmPackExpr::classof(), clang::OMPTargetTeamsDistributeParallelForSimdDirective::classof(), clang::FunctionParmPackExpr::classof(), clang::OMPTargetTeamsDistributeSimdDirective::classof(), clang::MaterializeTemporaryExpr::classof(), clang::InitListExpr::classof(), clang::CXXFoldExpr::classof(), clang::CoroutineSuspendExpr::classof(), clang::CoawaitExpr::classof(), clang::DependentCoawaitExpr::classof(), clang::CoyieldExpr::classof(), clang::DesignatedInitExpr::classof(), clang::NoInitExpr::classof(), clang::DesignatedInitUpdateExpr::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(), EvalAddr(), EvaluateStmt(), EvalVal(), GenerateMinimalPathDiagnostic(), clang::CallEventManager::getCaller(), clang::CXXNamedCastExpr::getCastName(), clang::Expr::getExprLoc(), getLoopCondition(), clang::threadSafety::getSourceLiteralString(), clang::CFGBlock::getTerminatorCondition(), clang::Expr::HasSideEffects(), isConditionForTerminator(), clang::Expr::isConstantInitializer(), isIdenticalStmt(), clang::CXXCtorInitializer::isInClassMemberInitializer(), isInLoop(), isInLoopBody(), isLoop(), clang::Expr::isUnusedResultAWarning(), requiresParensToAddCast(), reversePropagateIntererstingSymbols(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), clang::ento::ConditionBRVisitor::VisitTerminator(), and clang::ento::ConditionBRVisitor::VisitTrueTest().

◆ getStmtClassName()

const char * Stmt::getStmtClassName ( ) const

◆ IgnoreContainers()

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

Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true.

Definition at line 116 of file Stmt.cpp.

Referenced by clang::Sema::ActOnOpenMPTargetDirective(), CheckOpenMPLoop(), clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective(), and clang::OMPLoopDirective::getBody().

◆ IgnoreImplicit() [1/2]

Stmt * Stmt::IgnoreImplicit ( )

Skip past any implicit AST nodes which might surround this statement, such as ExprWithCleanups or ImplicitCastExpr nodes.

Definition at line 96 of file Stmt.cpp.

Referenced by clang::Expr::IgnoreImplicit().

◆ IgnoreImplicit() [2/2]

const Stmt* clang::Stmt::IgnoreImplicit ( ) const
inline

Definition at line 402 of file Stmt.h.

◆ operator delete() [1/5]

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

Definition at line 78 of file Stmt.h.

◆ operator delete() [2/5]

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

Definition at line 299 of file Stmt.h.

◆ operator delete() [3/5]

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

Definition at line 300 of file Stmt.h.

◆ operator delete() [4/5]

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

Definition at line 301 of file Stmt.h.

◆ operator delete() [5/5]

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

Definition at line 302 of file Stmt.h.

◆ operator new() [1/4]

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

Definition at line 75 of file Stmt.h.

◆ operator new() [2/4]

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

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

References bytes(), and AttributeLangSupport::C.

◆ operator new() [4/4]

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

Definition at line 297 of file Stmt.h.

◆ printPretty()

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

◆ PrintStats()

void Stmt::PrintStats ( )
static

Definition at line 62 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 1957 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 1951 of file StmtProfile.cpp.

Referenced by getSizeOfArgType(), clang::FunctionProtoType::isTemplateVariadic(), clang::DependentSizedExtVectorType::Profile(), and clang::DependentDecltypeType::Profile().

◆ stripLabelLikeStatements() [1/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 138 of file Stmt.cpp.

◆ stripLabelLikeStatements() [2/2]

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

Definition at line 411 of file Stmt.h.

◆ 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 21 of file StmtViz.cpp.

Friends And Related Function Documentation

◆ ASTStmtReader

friend class ASTStmtReader
friend

Definition at line 283 of file Stmt.h.

◆ ASTStmtWriter

friend class ASTStmtWriter
friend

Definition at line 284 of file Stmt.h.

Member Data Documentation

◆ @68

union { ... }

◆ CallExprBits

CallExprBitfields clang::Stmt::CallExprBits

Definition at line 274 of file Stmt.h.

Referenced by clang::CallExpr::CallExpr().

◆ CastExprBits

CastExprBitfields clang::Stmt::CastExprBits

Definition at line 273 of file Stmt.h.

◆ CharacterLiteralBits

CharacterLiteralBitfields clang::Stmt::CharacterLiteralBits

Definition at line 269 of file Stmt.h.

◆ CoawaitBits

CoawaitExprBitfields clang::Stmt::CoawaitBits

◆ CompoundStmtBits

CompoundStmtBitfields clang::Stmt::CompoundStmtBits

Definition at line 266 of file Stmt.h.

Referenced by clang::CompoundStmt::CompoundStmt(), and clang::CompoundStmt::setStmts().

◆ DeclRefExprBits

DeclRefExprBitfields clang::Stmt::DeclRefExprBits

Definition at line 272 of file Stmt.h.

Referenced by computeDeclRefDependence().

◆ ExprBits

ExprBitfields clang::Stmt::ExprBits

◆ ExprWithCleanupsBits

ExprWithCleanupsBitfields clang::Stmt::ExprWithCleanupsBits

◆ FloatingLiteralBits

FloatingLiteralBitfields clang::Stmt::FloatingLiteralBits

◆ IfStmtBits

IfStmtBitfields clang::Stmt::IfStmtBits

Definition at line 267 of file Stmt.h.

◆ InitListExprBits

InitListExprBitfields clang::Stmt::InitListExprBits

Definition at line 278 of file Stmt.h.

◆ ObjCIndirectCopyRestoreExprBits

ObjCIndirectCopyRestoreExprBitfields clang::Stmt::ObjCIndirectCopyRestoreExprBits

Definition at line 277 of file Stmt.h.

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

◆ PseudoObjectExprBits

PseudoObjectExprBitfields clang::Stmt::PseudoObjectExprBits

Definition at line 276 of file Stmt.h.

Referenced by clang::PseudoObjectExpr::Create().

◆ StmtBits

StmtBitfields clang::Stmt::StmtBits

Definition at line 265 of file Stmt.h.

◆ TypeTraitExprBits

TypeTraitExprBitfields clang::Stmt::TypeTraitExprBits

◆ UnaryExprOrTypeTraitExprBits

UnaryExprOrTypeTraitExprBitfields clang::Stmt::UnaryExprOrTypeTraitExprBits

Definition at line 271 of file Stmt.h.


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