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 }
 
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 (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 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 ()
 

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

◆ child_range

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

Definition at line 443 of file Stmt.h.

◆ const_child_iterator

Definition at line 441 of file Stmt.h.

◆ const_child_range

Definition at line 444 of file Stmt.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
NumStmtBits 

Definition at line 98 of file Stmt.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumExprBits 

Definition at line 149 of file Stmt.h.

◆ APFloatSemantics

Enumerator
IEEEhalf 
IEEEsingle 
IEEEdouble 
x87DoubleExtended 
IEEEquad 
PPCDoubleDouble 

Definition at line 159 of file Stmt.h.

◆ StmtClass

Enumerator
NoStmtClass 

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

Member Function Documentation

◆ addStmtClass()

void Stmt::addStmtClass ( const StmtClass  s)
static

Definition at line 103 of file Stmt.cpp.

References StmtClassNameTable::Counter, and getStmtInfoTableEntry().

◆ child_begin() [1/2]

child_iterator clang::Stmt::child_begin ( )
inline

Definition at line 452 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 455 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 456 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 447 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 2747 of file StmtPrinter.cpp.

References clang::ASTContext::getLangOpts().

◆ EnableStatistics()

void Stmt::EnableStatistics ( )
static

Definition at line 108 of file Stmt.cpp.

◆ getLocEnd()

SourceLocation Stmt::getLocEnd ( ) const

Definition at line 290 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::OpaqueValueExpr::getLocEnd(), clang::AttributedStmt::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 277 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(), 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(), IsEnumConstOrFromMacro(), isIdiomaticBraceElisionEntity(), 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 265 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(), AnalyzeBitFieldAssignment(), 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(), checkObjCCollectionLiteralElement(), clang::Sema::CheckObjCForCollectionOperand(), checkObjCPointerIntrospection(), checkOpenCLConditionVector(), checkOpenCLPipeArg(), checkOpenCLPipePacketType(), CheckOpenMPLoop(), clang::Sema::CheckPackExpansion(), checkPointerIntegerMismatch(), CheckReturnStackAddr(), CheckTautologicalComparison(), 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(), DiagnoseNullConversion(), 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(), clang::Sema::HandleExprPropertyRefExpr(), HandleNeonVectorTypeAttr(), HandleVectorSizeAttr(), clang::Sema::InvalidLogicalVectorOperands(), isDebuggingContext(), isIdiomaticBraceElisionEntity(), 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 378 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::CXXTryStmt::classof(), clang::ObjCAtCatchStmt::classof(), clang::OMPArraySectionExpr::classof(), clang::ObjCBoxedExpr::classof(), clang::CXXOperatorCallExpr::classof(), clang::ObjCAtFinallyStmt::classof(), clang::ObjCArrayLiteral::classof(), clang::CXXMemberCallExpr::classof(), clang::CXXForRangeStmt::classof(), clang::CUDAKernelCallExpr::classof(), clang::ObjCAtTryStmt::classof(), clang::CXXNamedCastExpr::classof(), clang::MSDependentExistsStmt::classof(), clang::ObjCAtSynchronizedStmt::classof(), clang::OMPParallelDirective::classof(), clang::CXXStaticCastExpr::classof(), clang::ObjCDictionaryLiteral::classof(), clang::ObjCAtThrowStmt::classof(), clang::ObjCAutoreleasePoolStmt::classof(), clang::CXXDynamicCastExpr::classof(), clang::ObjCEncodeExpr::classof(), clang::CXXReinterpretCastExpr::classof(), clang::CoroutineBodyStmt::classof(), clang::ObjCSelectorExpr::classof(), clang::CXXConstCastExpr::classof(), clang::ObjCProtocolExpr::classof(), clang::CoreturnStmt::classof(), clang::DeclStmt::classof(), clang::ObjCIvarRefExpr::classof(), clang::CXXBoolLiteralExpr::classof(), clang::CXXNullPtrLiteralExpr::classof(), clang::NullStmt::classof(), clang::CompoundStmt::classof(), clang::CXXTypeidExpr::classof(), clang::ObjCPropertyRefExpr::classof(), clang::SwitchCase::classof(), clang::MSPropertyRefExpr::classof(), clang::CaseStmt::classof(), clang::ObjCSubscriptRefExpr::classof(), clang::DefaultStmt::classof(), clang::MSPropertySubscriptExpr::classof(), clang::Expr::classof(), clang::LabelStmt::classof(), clang::CXXUuidofExpr::classof(), clang::AttributedStmt::classof(), clang::OpaqueValueExpr::classof(), clang::OMPLoopDirective::classof(), clang::CXXThisExpr::classof(), clang::IfStmt::classof(), clang::OMPSimdDirective::classof(), clang::CXXThrowExpr::classof(), clang::SwitchStmt::classof(), clang::CXXDefaultArgExpr::classof(), clang::OMPForDirective::classof(), clang::WhileStmt::classof(), clang::CXXDefaultInitExpr::classof(), clang::OMPForSimdDirective::classof(), clang::DeclRefExpr::classof(), clang::DoStmt::classof(), clang::CXXBindTemporaryExpr::classof(), clang::PredefinedExpr::classof(), clang::OMPSectionsDirective::classof(), clang::ForStmt::classof(), clang::GotoStmt::classof(), clang::OMPSectionDirective::classof(), clang::IntegerLiteral::classof(), clang::IndirectGotoStmt::classof(), clang::ObjCMessageExpr::classof(), clang::OMPSingleDirective::classof(), clang::ContinueStmt::classof(), clang::CharacterLiteral::classof(), clang::CXXConstructExpr::classof(), clang::BreakStmt::classof(), clang::OMPMasterDirective::classof(), clang::ObjCIsaExpr::classof(), clang::FloatingLiteral::classof(), clang::ReturnStmt::classof(), clang::CXXInheritedCtorInitExpr::classof(), clang::OMPCriticalDirective::classof(), clang::ImaginaryLiteral::classof(), clang::ObjCIndirectCopyRestoreExpr::classof(), clang::CXXFunctionalCastExpr::classof(), clang::AsmStmt::classof(), clang::OMPParallelForDirective::classof(), clang::CXXTemporaryObjectExpr::classof(), clang::ObjCBridgedCastExpr::classof(), clang::ObjCAvailabilityCheckExpr::classof(), clang::OMPParallelForSimdDirective::classof(), clang::StringLiteral::classof(), clang::OMPParallelSectionsDirective::classof(), clang::ParenExpr::classof(), clang::OMPTaskDirective::classof(), clang::LambdaExpr::classof(), clang::GCCAsmStmt::classof(), clang::OMPTaskyieldDirective::classof(), clang::UnaryOperator::classof(), clang::CXXScalarValueInitExpr::classof(), clang::OMPBarrierDirective::classof(), clang::MSAsmStmt::classof(), clang::OMPTaskwaitDirective::classof(), clang::SEHExceptStmt::classof(), clang::SEHFinallyStmt::classof(), clang::OMPTaskgroupDirective::classof(), clang::OffsetOfExpr::classof(), clang::SEHTryStmt::classof(), clang::OMPFlushDirective::classof(), clang::SEHLeaveStmt::classof(), clang::CXXNewExpr::classof(), clang::OMPOrderedDirective::classof(), clang::UnaryExprOrTypeTraitExpr::classof(), clang::CXXDeleteExpr::classof(), clang::ArraySubscriptExpr::classof(), clang::OMPAtomicDirective::classof(), clang::CapturedStmt::classof(), clang::OMPTargetDirective::classof(), clang::CXXPseudoDestructorExpr::classof(), clang::OMPTargetDataDirective::classof(), clang::CallExpr::classof(), clang::OMPTargetEnterDataDirective::classof(), clang::TypeTraitExpr::classof(), clang::OMPTargetExitDataDirective::classof(), clang::ArrayTypeTraitExpr::classof(), clang::OMPTargetParallelDirective::classof(), clang::ExpressionTraitExpr::classof(), clang::OMPTargetParallelForDirective::classof(), clang::MemberExpr::classof(), clang::OMPTeamsDirective::classof(), clang::CompoundLiteralExpr::classof(), clang::OMPCancellationPointDirective::classof(), clang::OverloadExpr::classof(), clang::OMPCancelDirective::classof(), clang::CastExpr::classof(), clang::OMPTaskLoopDirective::classof(), clang::UnresolvedLookupExpr::classof(), clang::ImplicitCastExpr::classof(), clang::OMPTaskLoopSimdDirective::classof(), clang::ExplicitCastExpr::classof(), clang::CStyleCastExpr::classof(), clang::OMPDistributeDirective::classof(), clang::DependentScopeDeclRefExpr::classof(), clang::OMPTargetUpdateDirective::classof(), clang::ExprWithCleanups::classof(), clang::OMPDistributeParallelForDirective::classof(), clang::OMPDistributeParallelForSimdDirective::classof(), clang::CXXUnresolvedConstructExpr::classof(), clang::OMPDistributeSimdDirective::classof(), clang::AbstractConditionalOperator::classof(), clang::OMPTargetParallelForSimdDirective::classof(), clang::ConditionalOperator::classof(), clang::OMPTargetSimdDirective::classof(), clang::CXXDependentScopeMemberExpr::classof(), clang::BinaryConditionalOperator::classof(), clang::OMPTeamsDistributeDirective::classof(), clang::AddrLabelExpr::classof(), clang::OMPTeamsDistributeSimdDirective::classof(), clang::StmtExpr::classof(), clang::ShuffleVectorExpr::classof(), clang::UnresolvedMemberExpr::classof(), clang::OMPTeamsDistributeParallelForSimdDirective::classof(), clang::CXXNoexceptExpr::classof(), clang::OMPTeamsDistributeParallelForDirective::classof(), clang::ConvertVectorExpr::classof(), clang::OMPTargetTeamsDirective::classof(), clang::PackExpansionExpr::classof(), clang::ChooseExpr::classof(), clang::GNUNullExpr::classof(), clang::OMPTargetTeamsDistributeDirective::classof(), clang::VAArgExpr::classof(), clang::SizeOfPackExpr::classof(), clang::OMPTargetTeamsDistributeParallelForDirective::classof(), clang::SubstNonTypeTemplateParmExpr::classof(), clang::OMPTargetTeamsDistributeParallelForSimdDirective::classof(), clang::SubstNonTypeTemplateParmPackExpr::classof(), clang::OMPTargetTeamsDistributeSimdDirective::classof(), clang::FunctionParmPackExpr::classof(), clang::InitListExpr::classof(), clang::MaterializeTemporaryExpr::classof(), clang::CXXFoldExpr::classof(), clang::CoroutineSuspendExpr::classof(), clang::CoawaitExpr::classof(), clang::DesignatedInitExpr::classof(), clang::DependentCoawaitExpr::classof(), clang::CoyieldExpr::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(), FindTypeTagExpr(), 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() [1/2]

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

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

◆ IgnoreContainers() [2/2]

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

Definition at line 427 of file Stmt.h.

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

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

◆ IgnoreImplicit() [2/2]

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

Definition at line 420 of file Stmt.h.

◆ operator delete() [1/5]

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

Definition at line 88 of file Stmt.h.

◆ operator delete() [2/5]

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

Definition at line 316 of file Stmt.h.

◆ operator delete() [3/5]

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

Definition at line 317 of file Stmt.h.

◆ operator delete() [4/5]

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

Definition at line 318 of file Stmt.h.

◆ operator delete() [5/5]

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

Definition at line 319 of file Stmt.h.

◆ operator new() [1/4]

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

Definition at line 84 of file Stmt.h.

◆ operator new() [2/4]

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

Definition at line 69 of file Stmt.cpp.

References bytes(), and clang::C.

◆ operator new() [3/4]

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

Definition at line 309 of file Stmt.h.

References bytes().

◆ operator new() [4/4]

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

Definition at line 314 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 78 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 1960 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 1954 of file StmtProfile.cpp.

Referenced by getSizeOfArgType(), clang::FunctionProtoType::isTemplateVariadic(), clang::DependentAddressSpaceType::Profile(), 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 154 of file Stmt.cpp.

◆ stripLabelLikeStatements() [2/2]

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

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

◆ ASTStmtWriter

friend class ASTStmtWriter
friend

Definition at line 82 of file Stmt.h.

Member Data Documentation

◆ @68

union { ... }

◆ CallExprBits

CallExprBitfields clang::Stmt::CallExprBits

Definition at line 294 of file Stmt.h.

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

◆ CastExprBits

CastExprBitfields clang::Stmt::CastExprBits

Definition at line 293 of file Stmt.h.

◆ CharacterLiteralBits

CharacterLiteralBitfields clang::Stmt::CharacterLiteralBits

Definition at line 289 of file Stmt.h.

◆ CoawaitBits

CoawaitExprBitfields clang::Stmt::CoawaitBits

◆ CompoundStmtBits

CompoundStmtBitfields clang::Stmt::CompoundStmtBits

Definition at line 286 of file Stmt.h.

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

◆ DeclRefExprBits

DeclRefExprBitfields clang::Stmt::DeclRefExprBits

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

◆ InitListExprBits

InitListExprBitfields clang::Stmt::InitListExprBits

Definition at line 298 of file Stmt.h.

◆ ObjCIndirectCopyRestoreExprBits

ObjCIndirectCopyRestoreExprBitfields clang::Stmt::ObjCIndirectCopyRestoreExprBits

Definition at line 297 of file Stmt.h.

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

◆ PseudoObjectExprBits

PseudoObjectExprBitfields clang::Stmt::PseudoObjectExprBits

Definition at line 296 of file Stmt.h.

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

◆ StmtBits

StmtBitfields clang::Stmt::StmtBits

Definition at line 285 of file Stmt.h.

◆ TypeTraitExprBits

TypeTraitExprBitfields clang::Stmt::TypeTraitExprBits

◆ UnaryExprOrTypeTraitExprBits

UnaryExprOrTypeTraitExprBitfields clang::Stmt::UnaryExprOrTypeTraitExprBits

Definition at line 291 of file Stmt.h.


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