clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
clang::Stmt Class Reference

#include <Stmt.h>

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

List of all members.

Classes

class  CallExprBitfields
class  CastExprBitfields
class  CompoundStmtBitfields
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
class  ExprWithCleanupsBitfields
class  ObjCIndirectCopyRestoreExprBitfields
class  PseudoObjectExprBitfields
class  StmtBitfields

Public Types

enum  StmtClass { NoStmtClass = 0 }
typedef StmtIterator child_iterator
typedef ConstStmtIterator const_child_iterator
typedef StmtRange child_range
typedef ConstStmtRange const_child_range

Public Member Functions

void * operator new (size_t bytes, ASTContext &C, unsigned alignment=8) throw ()
void * operator new (size_t bytes, ASTContext *C, unsigned alignment=8) throw ()
void * operator new (size_t bytes, void *mem) throw ()
void operator delete (void *, ASTContext &, unsigned) throw ()
void operator delete (void *, ASTContext *, unsigned) throw ()
void operator delete (void *, std::size_t) throw ()
void operator delete (void *, void *) throw ()
 Stmt (StmtClass SC)
StmtClass getStmtClass () const
const char * getStmtClassName () const
SourceRange getSourceRange () const
SourceLocation getLocStart () const
SourceLocation getLocEnd () const
void dump () const
void dump (SourceManager &SM) const
void dump (raw_ostream &OS, SourceManager &SM) const
void dumpAll () const
 dumpAll - This does a dump of the specified AST fragment and all subtrees.
void dumpAll (SourceManager &SM) const
 dumpAll - This does a dump of the specified AST fragment and all subtrees.
void dumpPretty (ASTContext &Context) const
void printPretty (raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0) const
void printPretty (raw_ostream &OS, ASTContext &Context, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0) const
void viewAST () const
StmtIgnoreImplicit ()
const StmtstripLabelLikeStatements () const
 Strip off all label-like statements.
StmtstripLabelLikeStatements ()
bool hasImplicitControlFlow () const
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.

Static Public Member Functions

static void addStmtClass (const StmtClass s)
static bool CollectingStats (bool Enable=false)
static void PrintStats ()
static bool classof (const Stmt *)

Protected Types

enum  { NumStmtBits = 8 }
enum  { NumExprBits = 16 }

Protected Member Functions

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

Protected Attributes

union {
   void *   Aligner
   StmtBitfields   StmtBits
   CompoundStmtBitfields   CompoundStmtBits
   ExprBitfields   ExprBits
   DeclRefExprBitfields   DeclRefExprBits
   CastExprBitfields   CastExprBits
   CallExprBitfields   CallExprBits
   ExprWithCleanupsBitfields   ExprWithCleanupsBits
   PseudoObjectExprBitfields   PseudoObjectExprBits
   ObjCIndirectCopyRestoreExprBitfields   ObjCIndirectCopyRestoreExprBits
}; 

Friends

class ASTStmtReader

Detailed Description

Stmt - This represents one statement.

Definition at line 94 of file Stmt.h.


Member Typedef Documentation

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

Definition at line 346 of file Stmt.h.

Definition at line 344 of file Stmt.h.

Definition at line 347 of file Stmt.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
NumStmtBits 

Definition at line 122 of file Stmt.h.

anonymous enum [protected]
Enumerator:
NumExprBits 

Definition at line 160 of file Stmt.h.

Enumerator:
NoStmtClass 

Definition at line 96 of file Stmt.h.


Constructor & Destructor Documentation

clang::Stmt::Stmt ( StmtClass  SC,
EmptyShell   
) [inline, explicit, protected]

Construct an empty statement.

Definition at line 263 of file Stmt.h.

References addStmtClass(), CollectingStats(), and StmtBits.

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

Definition at line 269 of file Stmt.h.

References addStmtClass(), CollectingStats(), and StmtBits.


Member Function Documentation

void Stmt::addStmtClass ( const StmtClass  s) [static]

Definition at line 77 of file Stmt.cpp.

References StmtClassNameTable::Counter, and getStmtInfoTableEntry().

Referenced by Stmt().

child_iterator clang::Stmt::child_begin ( ) [inline]
const_child_iterator clang::Stmt::child_begin ( ) const [inline]

Definition at line 357 of file Stmt.h.

References children().

child_iterator clang::Stmt::child_end ( ) [inline]
const_child_iterator clang::Stmt::child_end ( ) const [inline]

Definition at line 358 of file Stmt.h.

References children().

Stmt::child_range Stmt::children ( )

Reimplemented in clang::AtomicExpr, clang::PseudoObjectExpr, clang::AsTypeExpr, clang::BlockDeclRefExpr, clang::BlockExpr, clang::ExtVectorElementExpr, clang::GenericSelectionExpr, clang::ParenListExpr, clang::ImplicitValueInitExpr, clang::DesignatedInitExpr, clang::InitListExpr, clang::MaterializeTemporaryExpr, clang::VAArgExpr, clang::SubstNonTypeTemplateParmPackExpr, clang::GNUNullExpr, clang::ChooseExpr, clang::SubstNonTypeTemplateParmExpr, clang::SizeOfPackExpr, clang::ShuffleVectorExpr, clang::StmtExpr, clang::PackExpansionExpr, clang::AddrLabelExpr, clang::BinaryConditionalOperator, clang::CXXNoexceptExpr, clang::UnresolvedMemberExpr, clang::ConditionalOperator, clang::CXXDependentScopeMemberExpr, clang::BinaryOperator, clang::CXXUnresolvedConstructExpr, clang::CastExpr, clang::ExprWithCleanups, clang::DependentScopeDeclRefExpr, clang::CompoundLiteralExpr, clang::MemberExpr, clang::UnresolvedLookupExpr, clang::CallExpr, clang::ExpressionTraitExpr, clang::ArraySubscriptExpr, clang::ArrayTypeTraitExpr, clang::UnaryExprOrTypeTraitExpr, clang::BinaryTypeTraitExpr, clang::UnaryTypeTraitExpr, clang::OffsetOfExpr, clang::CXXPseudoDestructorExpr, clang::SEHTryStmt, clang::UnaryOperator, clang::CXXDeleteExpr, clang::SEHFinallyStmt, clang::SEHExceptStmt, clang::CXXNewExpr, clang::ParenExpr, clang::AsmStmt, clang::StringLiteral, clang::CXXScalarValueInitExpr, clang::ImaginaryLiteral, clang::LambdaExpr, clang::FloatingLiteral, clang::ReturnStmt, clang::CharacterLiteral, clang::BreakStmt, clang::ContinueStmt, clang::IntegerLiteral, clang::IndirectGotoStmt, clang::GotoStmt, clang::ObjCIndirectCopyRestoreExpr, clang::PredefinedExpr, clang::ForStmt, clang::DeclRefExpr, clang::ObjCIsaExpr, clang::DoStmt, clang::ObjCMessageExpr, clang::WhileStmt, clang::CXXConstructExpr, clang::SwitchStmt, clang::CXXBindTemporaryExpr, clang::IfStmt, clang::CXXDefaultArgExpr, clang::LabelStmt, clang::OpaqueValueExpr, clang::DefaultStmt, clang::CaseStmt, clang::CXXThrowExpr, clang::CXXThisExpr, clang::CompoundStmt, clang::CXXUuidofExpr, clang::NullStmt, clang::CXXTypeidExpr, clang::DeclStmt, clang::ObjCPropertyRefExpr, clang::CXXNullPtrLiteralExpr, clang::ObjCAutoreleasePoolStmt, clang::CXXBoolLiteralExpr, clang::ObjCAtThrowStmt, clang::ObjCAtSynchronizedStmt, clang::MSDependentExistsStmt, clang::ObjCAtTryStmt, clang::ObjCIvarRefExpr, clang::CXXForRangeStmt, clang::ObjCProtocolExpr, clang::ObjCAtFinallyStmt, clang::ObjCSelectorExpr, clang::ObjCAtCatchStmt, clang::CXXTryStmt, clang::ObjCEncodeExpr, clang::ObjCForCollectionStmt, clang::ObjCStringLiteral, and clang::CXXCatchStmt.

Definition at line 157 of file Stmt.cpp.

References getStmtClass(), and NoStmtClass.

Referenced by BuildParentMap(), CanSubExprsThrow(), child_begin(), child_end(), children(), clang::CodeGen::CodeGenFunction::containsBreak(), clang::CodeGen::CodeGenFunction::ContainsLabel(), clang::ento::containsStmt(), FindSubExprAssignments(), InitExprContainsUninitializedFields(), isAccessedBy(), isCapturedBy(), SearchForReturnInStmt(), clang::CFGStmtVisitor< ImplClass, void >::VisitChildren(), clang::EvaluatedExprVisitor< ImplClass >::VisitStmt(), and clang::idx::ASTVisitor< ImplClass >::VisitStmt().

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

Reimplemented in clang::CompoundStmt.

Definition at line 350 of file Stmt.h.

References children().

static bool clang::Stmt::classof ( const Stmt ) [inline, static]

Reimplemented in clang::AtomicExpr, clang::PseudoObjectExpr, clang::AsTypeExpr, clang::BlockDeclRefExpr, clang::BlockExpr, clang::ExtVectorElementExpr, clang::GenericSelectionExpr, clang::ParenListExpr, clang::ImplicitValueInitExpr, clang::DesignatedInitExpr, clang::InitListExpr, clang::MaterializeTemporaryExpr, clang::VAArgExpr, clang::SubstNonTypeTemplateParmPackExpr, clang::GNUNullExpr, clang::ChooseExpr, clang::SubstNonTypeTemplateParmExpr, clang::SizeOfPackExpr, clang::ShuffleVectorExpr, clang::StmtExpr, clang::PackExpansionExpr, clang::AddrLabelExpr, clang::BinaryConditionalOperator, clang::CXXNoexceptExpr, clang::UnresolvedMemberExpr, clang::ConditionalOperator, clang::AbstractConditionalOperator, clang::CXXDependentScopeMemberExpr, clang::CompoundAssignOperator, clang::BinaryOperator, clang::CStyleCastExpr, clang::CXXUnresolvedConstructExpr, clang::ExplicitCastExpr, clang::ImplicitCastExpr, clang::CastExpr, clang::ExprWithCleanups, clang::DependentScopeDeclRefExpr, clang::CompoundLiteralExpr, clang::MemberExpr, clang::UnresolvedLookupExpr, clang::OverloadExpr, clang::CallExpr, clang::ExpressionTraitExpr, clang::ArraySubscriptExpr, clang::ArrayTypeTraitExpr, clang::UnaryExprOrTypeTraitExpr, clang::BinaryTypeTraitExpr, clang::UnaryTypeTraitExpr, clang::OffsetOfExpr, clang::CXXPseudoDestructorExpr, clang::SEHTryStmt, clang::UnaryOperator, clang::CXXDeleteExpr, clang::SEHFinallyStmt, clang::SEHExceptStmt, clang::CXXNewExpr, clang::ParenExpr, clang::AsmStmt, clang::StringLiteral, clang::CXXScalarValueInitExpr, clang::ImaginaryLiteral, clang::LambdaExpr, clang::FloatingLiteral, clang::ReturnStmt, clang::CharacterLiteral, clang::BreakStmt, clang::ContinueStmt, clang::IntegerLiteral, clang::IndirectGotoStmt, clang::ObjCBridgedCastExpr, clang::GotoStmt, clang::ObjCIndirectCopyRestoreExpr, clang::PredefinedExpr, clang::ForStmt, clang::DeclRefExpr, clang::ObjCIsaExpr, clang::CXXTemporaryObjectExpr, clang::DoStmt, clang::CXXFunctionalCastExpr, clang::ObjCMessageExpr, clang::WhileStmt, clang::CXXConstructExpr, clang::SwitchStmt, clang::IfStmt, clang::CXXBindTemporaryExpr, clang::OpaqueValueExpr, clang::LabelStmt, clang::CXXDefaultArgExpr, clang::DefaultStmt, clang::Expr, clang::CaseStmt, clang::CXXThrowExpr, clang::SwitchCase, clang::CXXThisExpr, clang::CompoundStmt, clang::CXXUuidofExpr, clang::NullStmt, clang::CXXTypeidExpr, clang::DeclStmt, clang::ObjCPropertyRefExpr, clang::CXXNullPtrLiteralExpr, clang::ObjCAutoreleasePoolStmt, clang::CXXBoolLiteralExpr, clang::ObjCAtThrowStmt, clang::CXXConstCastExpr, clang::ObjCAtSynchronizedStmt, clang::CXXReinterpretCastExpr, clang::MSDependentExistsStmt, clang::CXXDynamicCastExpr, clang::ObjCAtTryStmt, clang::CXXStaticCastExpr, clang::ObjCIvarRefExpr, clang::CXXForRangeStmt, clang::CXXNamedCastExpr, clang::ObjCProtocolExpr, clang::CUDAKernelCallExpr, clang::ObjCAtFinallyStmt, clang::ObjCSelectorExpr, clang::CXXMemberCallExpr, clang::ObjCAtCatchStmt, clang::CXXTryStmt, clang::ObjCEncodeExpr, clang::CXXOperatorCallExpr, clang::ObjCForCollectionStmt, clang::ObjCStringLiteral, and clang::CXXCatchStmt.

Definition at line 331 of file Stmt.h.

bool Stmt::CollectingStats ( bool  Enable = false) [static]

Definition at line 83 of file Stmt.cpp.

References StatSwitch.

Referenced by clang::ParseAST(), and Stmt().

void Stmt::dump ( ) const

dump - This does a local dump of the specified AST fragment. It dumps the specified node and a few nodes underneath it, but not the whole subtree. This is useful in a debugger.

Definition at line 704 of file StmtDumper.cpp.

References P.

Referenced by dump(), and printPretty().

void Stmt::dump ( SourceManager SM) const

dump - This does a local dump of the specified AST fragment. It dumps the specified node and a few nodes underneath it, but not the whole subtree. This is useful in a debugger.

Definition at line 691 of file StmtDumper.cpp.

References dump().

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

Definition at line 695 of file StmtDumper.cpp.

References P.

void Stmt::dumpAll ( ) const

dumpAll - This does a dump of the specified AST fragment and all subtrees.

Definition at line 718 of file StmtDumper.cpp.

References P.

void Stmt::dumpAll ( SourceManager SM) const

dumpAll - This does a dump of the specified AST fragment and all subtrees.

Definition at line 711 of file StmtDumper.cpp.

References P.

void Stmt::dumpPretty ( 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 1744 of file StmtPrinter.cpp.

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

SourceLocation clang::Stmt::getLocEnd ( ) const [inline]

Definition at line 285 of file Stmt.h.

References clang::SourceRange::getEnd(), and getSourceRange().

Referenced by clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnLambdaExpr(), clang::Sema::ActOnPropertyImplDecl(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildCStyleCastExpr(), clang::Sema::BuildCXXFunctionalCastExpr(), clang::Sema::BuildCXXMemberCallExpr(), checkArgCount(), clang::Sema::CheckLogicalOperands(), clang::ento::containsMacro(), clang::Sema::ConvertToIntegralOrEnumerationType(), clang::Sema::DefaultVariadicArgumentPromotion(), clang::InitializationSequence::Diagnose(), DiagnoseBitwisePrecedence(), DiagnoseConditionalPrecedence(), DiagnoseNarrowingInInitList(), clang::Sema::DiagnoseSentinelCalls(), clang::CodeGen::CodeGenFunction::EmitStopPoint(), clang::CXXTryStmt::getEndLoc(), clang::SEHExceptStmt::getEndLoc(), clang::SEHFinallyStmt::getEndLoc(), clang::SEHTryStmt::getEndLoc(), clang::CXXCatchStmt::getSourceRange(), clang::ObjCStringLiteral::getSourceRange(), clang::ObjCForCollectionStmt::getSourceRange(), clang::ObjCAtCatchStmt::getSourceRange(), clang::ObjCAtFinallyStmt::getSourceRange(), clang::CXXForRangeStmt::getSourceRange(), clang::ObjCAtTryStmt::getSourceRange(), clang::MSDependentExistsStmt::getSourceRange(), clang::ObjCAtSynchronizedStmt::getSourceRange(), clang::ObjCAtThrowStmt::getSourceRange(), clang::ObjCAutoreleasePoolStmt::getSourceRange(), clang::CaseStmt::getSourceRange(), clang::DefaultStmt::getSourceRange(), clang::LabelStmt::getSourceRange(), clang::IfStmt::getSourceRange(), clang::SwitchStmt::getSourceRange(), clang::CXXConstructExpr::getSourceRange(), clang::WhileStmt::getSourceRange(), clang::ForStmt::getSourceRange(), clang::ObjCBridgedCastExpr::getSourceRange(), clang::IndirectGotoStmt::getSourceRange(), clang::ReturnStmt::getSourceRange(), clang::CXXDeleteExpr::getSourceRange(), clang::UnaryOperator::getSourceRange(), clang::CallExpr::getSourceRange(), clang::EnumConstantDecl::getSourceRange(), clang::CompoundLiteralExpr::getSourceRange(), clang::BinaryOperator::getSourceRange(), clang::ConditionalOperator::getSourceRange(), clang::BinaryConditionalOperator::getSourceRange(), clang::BlockDecl::getSourceRange(), clang::BlockExpr::getSourceRange(), clang::Expr::isUnusedResultAWarning(), clang::Sema::SemaBuiltinShuffleVector(), and clang::FunctionDecl::setBody().

SourceLocation clang::Stmt::getLocStart ( ) const [inline]

Definition at line 284 of file Stmt.h.

References clang::SourceRange::getBegin(), and getSourceRange().

Referenced by clang::Sema::ActOnAsmStmt(), clang::Sema::ActOnCallExpr(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnCXXForRangeStmt(), clang::Sema::ActOnCXXTryBlock(), clang::Sema::ActOnDesignatedInitializer(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::AddConversionCandidate(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildArrayType(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildInstanceMessage(), clang::Sema::BuildOverloadedCallExpr(), clang::Sema::BuildVAArgExpr(), CanCalleeThrow(), CastForMoving(), checkArgCount(), CheckAsmLValue(), CheckBuiltinAnnotationString(), clang::Sema::CheckCompareOperands(), checkCondition(), checkConditionalConvertScalarsToVectors(), checkConditionalVoidType(), CheckConstexprDeclStmt(), clang::Sema::CheckConstexprFunctionBody(), CheckEvalInICE(), CheckICE(), CheckNonTypeClassTemplatePartialSpecializationArgs(), CheckTemplateArgumentAddressOfObjectOrFunction(), clang::ento::containsMacro(), ConvertForConditional(), clang::Sema::ConvertToIntegralOrEnumerationType(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateGenericSelectionExpr(), clang::Sema::DefaultVariadicArgumentPromotion(), DiagnoseBitwisePrecedence(), DiagnoseConditionalPrecedence(), clang::Sema::DiagnoseDtorReference(), clang::Sema::DiagnoseEqualityWithExtraParens(), DiagnoseNarrowingInInitList(), clang::Sema::DiagnoseUnexpandedParameterPack(), DiagnoseUninitializedUse(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), clang::CodeGen::CodeGenFunction::EmitStopPoint(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), getAsmSrcLocInfo(), getInitializationLoc(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), clang::ObjCMessageExpr::getSelectorStartLoc(), clang::ObjCIvarRefExpr::getSourceRange(), clang::ObjCPropertyRefExpr::getSourceRange(), clang::ObjCIsaExpr::getSourceRange(), clang::UnaryOperator::getSourceRange(), clang::ArraySubscriptExpr::getSourceRange(), clang::CallExpr::getSourceRange(), clang::BinaryOperator::getSourceRange(), clang::ConditionalOperator::getSourceRange(), clang::BinaryConditionalOperator::getSourceRange(), clang::PackExpansionExpr::getSourceRange(), clang::ExtVectorElementExpr::getSourceRange(), GetUnreachableLoc(), getValidSourceLocation(), handleAnnotateAttr(), handleDeprecatedAttr(), handleSectionAttr(), handleUnavailableAttr(), clang::Sema::ImpCastExprToType(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), clang::Sema::InstantiateInitializer(), clang::Sema::IsIntegralPromotion(), clang::Sema::IsMemberPointerConversion(), clang::Sema::IsPointerConversion(), clang::Expr::isUnusedResultAWarning(), clang::IsUserDefinedConversion(), isValidDeadStmt(), MakeObjCStringLiteralFixItHint(), clang::Sema::ParseObjCStringLiteral(), clang::InitializationSequence::Perform(), clang::Sema::PerformCopyInitialization(), clang::Sema::PerformImplicitConversion(), clang::ento::SubEngine::processBranch(), clang::ento::ExprEngine::ProcessStmt(), clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr(), clang::Rewriter::ReplaceStmt(), clang::Sema::RequireCompleteExprType(), clang::Sema::ResolveAddressOfOverloadedFunction(), clang::Sema::SemaBuiltinShuffleVector(), TryClassUnification(), clang::TryCopyInitialization(), clang::TryListConversion(), TryLValueToRValueCast(), TryReferenceInitializationCore(), TryReferenceListInitialization(), TryRefInitWithConversionFunction(), TryUserDefinedConversion(), clang::ASTNodeImporter::VisitExpr(), and clang::ASTNodeImporter::VisitStmt().

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.

Reimplemented in clang::AtomicExpr, clang::PseudoObjectExpr, clang::AsTypeExpr, clang::BlockDeclRefExpr, clang::BlockExpr, clang::ExtVectorElementExpr, clang::GenericSelectionExpr, clang::ParenListExpr, clang::ImplicitValueInitExpr, clang::DesignatedInitExpr, clang::InitListExpr, clang::MaterializeTemporaryExpr, clang::VAArgExpr, clang::SubstNonTypeTemplateParmPackExpr, clang::GNUNullExpr, clang::ChooseExpr, clang::SubstNonTypeTemplateParmExpr, clang::SizeOfPackExpr, clang::ShuffleVectorExpr, clang::StmtExpr, clang::PackExpansionExpr, clang::AddrLabelExpr, clang::BinaryConditionalOperator, clang::CXXNoexceptExpr, clang::UnresolvedMemberExpr, clang::ConditionalOperator, clang::CXXDependentScopeMemberExpr, clang::BinaryOperator, clang::CStyleCastExpr, clang::CXXUnresolvedConstructExpr, clang::ImplicitCastExpr, clang::ExprWithCleanups, clang::DependentScopeDeclRefExpr, clang::CompoundLiteralExpr, clang::MemberExpr, clang::UnresolvedLookupExpr, clang::CallExpr, clang::ExpressionTraitExpr, clang::ArraySubscriptExpr, clang::ArrayTypeTraitExpr, clang::UnaryExprOrTypeTraitExpr, clang::BinaryTypeTraitExpr, clang::UnaryTypeTraitExpr, clang::OffsetOfExpr, clang::CXXPseudoDestructorExpr, clang::SEHTryStmt, clang::UnaryOperator, clang::CXXDeleteExpr, clang::SEHFinallyStmt, clang::SEHExceptStmt, clang::CXXNewExpr, clang::ParenExpr, clang::StringLiteral, clang::AsmStmt, clang::CXXScalarValueInitExpr, clang::ImaginaryLiteral, clang::LambdaExpr, clang::FloatingLiteral, clang::ReturnStmt, clang::CharacterLiteral, clang::BreakStmt, clang::ContinueStmt, clang::IntegerLiteral, clang::IndirectGotoStmt, clang::ObjCBridgedCastExpr, clang::GotoStmt, clang::ObjCIndirectCopyRestoreExpr, clang::PredefinedExpr, clang::ForStmt, clang::CXXTemporaryObjectExpr, clang::ObjCIsaExpr, clang::DoStmt, clang::CXXFunctionalCastExpr, clang::ObjCMessageExpr, clang::WhileStmt, clang::CXXConstructExpr, clang::SwitchStmt, clang::DeclRefExpr, clang::CXXBindTemporaryExpr, clang::IfStmt, clang::LabelStmt, clang::OpaqueValueExpr, clang::CXXDefaultArgExpr, clang::DefaultStmt, clang::CaseStmt, clang::CXXThrowExpr, clang::SwitchCase, clang::CXXThisExpr, clang::CompoundStmt, clang::CXXUuidofExpr, clang::NullStmt, clang::CXXTypeidExpr, clang::DeclStmt, clang::ObjCPropertyRefExpr, clang::CXXNullPtrLiteralExpr, clang::ObjCAutoreleasePoolStmt, clang::CXXBoolLiteralExpr, clang::ObjCAtThrowStmt, clang::ObjCAtSynchronizedStmt, clang::MSDependentExistsStmt, clang::ObjCAtTryStmt, clang::ObjCIvarRefExpr, clang::CXXForRangeStmt, clang::CXXNamedCastExpr, clang::ObjCProtocolExpr, clang::ObjCAtFinallyStmt, clang::ObjCSelectorExpr, clang::ObjCAtCatchStmt, clang::ObjCEncodeExpr, clang::CXXTryStmt, clang::CXXOperatorCallExpr, clang::ObjCForCollectionStmt, clang::ObjCStringLiteral, and clang::CXXCatchStmt.

Definition at line 169 of file Stmt.cpp.

References getStmtClass(), and NoStmtClass.

Referenced by clang::Sema::ActOnAsmStmt(), clang::Sema::ActOnAsTypeExpr(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnDependentMemberExpr(), clang::Sema::ActOnDesignatedInitializer(), clang::Sema::ActOnFinishSwitchStmt(), clang::Sema::ActOnObjCAtSynchronizedOperand(), clang::Sema::ActOnObjCForCollectionOperand(), clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::ActOnParamDefaultArgument(), clang::Sema::ActOnReturnStmt(), clang::Sema::ActOnStartOfSwitchStmt(), clang::Sema::ActOnStaticAssertDeclaration(), clang::Sema::AddAlignedAttr(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildArrayType(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildCXXDefaultArgExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildDeclaratorGroup(), clang::Sema::BuildExtVectorType(), clang::Sema::BuildInstanceMessage(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildObjCAtThrowStmt(), clang::Sema::BuildObjCBridgedCast(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildOverloadedCallExpr(), clang::Sema::BuildPseudoDestructorExpr(), clang::Sema::BuildResolvedCallExpr(), clang::Sema::BuildVAArgExpr(), CanCalleeThrow(), CastForMoving(), clang::Sema::CheckAddressOfMemberAccess(), CheckAddressOfOperand(), CheckAlignOfExpr(), checkArgCount(), checkArithmethicPointerOnNonFragileABI(), checkArithmeticIncompletePointerType(), checkArithmeticNull(), CheckArrayDesignatorExpr(), CheckAsmLValue(), clang::Sema::CheckBooleanCondition(), CheckBuiltinAnnotationString(), clang::Sema::CheckCastAlign(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckCompleteVariableDeclaration(), checkConditionalBlockPointerCompatibility(), clang::Sema::CheckConditionalOperands(), checkConditionalPointerCompatibility(), checkConditionalVoidType(), clang::Sema::CheckConvertedConstantExpression(), CheckCXX98CompatAccessibleCopy(), clang::Sema::CheckCXXThrowOperand(), checkEnumComparison(), clang::Sema::CheckEnumConstant(), clang::Sema::CheckExceptionSpecCompatibility(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::CheckForConstantInitializer(), CheckForDanglingReferenceOrPointer(), CheckForModifiableLvalue(), CheckIncrementDecrementOperand(), checkIndirectCopyRestoreSource(), CheckIndirectionOperand(), clang::Sema::CheckLogicalOperands(), clang::Sema::CheckMemberOperatorAccess(), clang::Sema::CheckMemberPointerConversion(), clang::Sema::CheckMessageArgumentTypes(), clang::Sema::CheckMultiplyDivideOperands(), CheckNonTypeClassTemplatePartialSpecializationArgs(), clang::Sema::CheckPackExpansion(), clang::Sema::CheckPointerConversion(), checkPointerIntegerMismatch(), clang::Sema::CheckPointerToMemberOperands(), clang::Sema::CheckRegparmAttr(), clang::Sema::CheckRemainderOperands(), clang::Sema::CheckStaticArrayArgument(), CheckStringInit(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), clang::Sema::CheckTemplateArgumentPointerToMember(), clang::Sema::CheckUnaryExprOrTypeTraitOperand(), clang::Sema::checkUnsafeAssigns(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::CheckVariableDeclaration(), clang::Sema::CheckVectorOperands(), clang::Sema::ConvertArgumentsForCall(), convertPointersToCompositeType(), clang::Sema::ConvertToIntegralOrEnumerationType(), CopyObject(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateBuiltinUnaryOp(), clang::Sema::CreateGenericSelectionExpr(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::Sema::CreateUnaryExprOrTypeTraitExpr(), clang::Sema::CXXCheckConditionalOperands(), clang::InitializationSequence::Diagnose(), diagnoseAddressOfInvalidType(), diagnoseArithmeticOnFunctionPointer(), diagnoseArithmeticOnTwoFunctionPointers(), diagnoseArithmeticOnTwoVoidPointers(), diagnoseArithmeticOnVoidPointer(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::Sema::DiagnoseAssignmentResult(), clang::Sema::DiagnoseAutoDeductionFailure(), diagnoseBadCast(), DiagnoseBadShiftValues(), DiagnoseBitwisePrecedence(), clang::Sema::DiagnoseConditionalForNull(), DiagnoseConditionalPrecedence(), diagnoseDistinctPointerComparison(), clang::Sema::DiagnoseEqualityWithExtraParens(), diagnoseFunctionPointerToVoidComparison(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), DiagnoseNarrowingInInitList(), diagnoseObjCARCConversion(), diagnosePointerIncompatibility(), diagnoseRetainCycle(), DiagnoseSelfAssignment(), diagnoseUnknownAnyExpr(), DiagnoseUnusedComparison(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), EvaluateArrayTypeTrait(), clang::Sema::FindCompositeObjCPointerType(), FindConditionalOverload(), clang::Sema::GatherArgumentsForCall(), clang::ento::ObjCMessage::getArgSourceRange(), clang::ento::CallOrObjCMessage::getArgSourceRange(), clang::ParmVarDecl::getDefaultArgRange(), clang::NonTypeTemplateParmDecl::getDefaultArgumentLoc(), clang::Sema::getExprRange(), getLocEnd(), getLocStart(), clang::ObjCMessageExpr::getReceiverRange(), clang::ento::ObjCMessage::getReceiverSourceRange(), clang::CXXOperatorCallExpr::getSourceRange(), clang::ento::ObjCMessage::getSourceRange(), clang::idx::ASTLocation::getSourceRange(), clang::TemplateArgumentLoc::getSourceRange(), clang::OpaqueValueExpr::getSourceRange(), clang::CXXBindTemporaryExpr::getSourceRange(), clang::ObjCIndirectCopyRestoreExpr::getSourceRange(), clang::ImaginaryLiteral::getSourceRange(), clang::CompoundLiteralExpr::getSourceRange(), clang::ExprWithCleanups::getSourceRange(), clang::ImplicitCastExpr::getSourceRange(), clang::CXXDependentScopeMemberExpr::getSourceRange(), clang::UnresolvedMemberExpr::getSourceRange(), clang::MaterializeTemporaryExpr::getSourceRange(), clang::PseudoObjectExpr::getSourceRange(), GetUnreachableLoc(), HandleAddressSpaceTypeAttribute(), handleConstructorAttr(), handleDestructorAttr(), clang::Sema::HandleExprPropertyRefExpr(), handleFormatArgAttr(), handleFormatAttr(), handleInitPriorityAttr(), handleLaunchBoundsAttr(), HandleMSP430InterruptAttr(), HandleNeonVectorTypeAttr(), handleNonNullAttr(), HandleOpenCLImageAccessAttribute(), handleOwnershipAttr(), handleReqdWorkGroupSize(), handleSentinelAttr(), HandleVectorSizeAttr(), clang::Sema::InvalidOperands(), clang::Expr::isUnusedResultAWarning(), clang::IsUserDefinedConversion(), clang::InitializationSequence::Perform(), clang::Sema::PerformContextuallyConvertToBool(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformObjectArgumentInitialization(), clang::Sema::PerformObjectMemberConversion(), clang::Rewriter::ReplaceStmt(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), SearchForReturnInStmt(), clang::Sema::SemaBuiltinShuffleVector(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), clang::TreeTransform< Derived >::TransformExprs(), tryDiagnoseOverloadedCast(), TryReinterpretCast(), clang::ConversionFixItGenerator::tryToFixConversion(), clang::Sema::tryToRecoverWithCall(), clang::Sema::VerifyBitField(), and clang::Sema::VerifyIntegerConstantExpression().

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

Definition at line 274 of file Stmt.h.

References StmtBits.

Referenced by clang::CFG::BuildOptions::alwaysAdd(), clang::CFGStmtVisitor< ImplClass, void >::BlockStmt_Visit(), clang::Expr::CanThrow(), CheckICE(), children(), ClassifyInternal(), clang::CXXCatchStmt::classof(), clang::ObjCStringLiteral::classof(), clang::ObjCForCollectionStmt::classof(), clang::CXXOperatorCallExpr::classof(), clang::ObjCEncodeExpr::classof(), clang::CXXTryStmt::classof(), clang::ObjCAtCatchStmt::classof(), clang::CXXMemberCallExpr::classof(), clang::ObjCSelectorExpr::classof(), clang::ObjCAtFinallyStmt::classof(), clang::CUDAKernelCallExpr::classof(), clang::ObjCProtocolExpr::classof(), clang::CXXNamedCastExpr::classof(), clang::CXXForRangeStmt::classof(), clang::ObjCIvarRefExpr::classof(), clang::CXXStaticCastExpr::classof(), clang::ObjCAtTryStmt::classof(), clang::CXXDynamicCastExpr::classof(), clang::MSDependentExistsStmt::classof(), clang::CXXReinterpretCastExpr::classof(), clang::ObjCAtSynchronizedStmt::classof(), clang::CXXConstCastExpr::classof(), clang::ObjCAtThrowStmt::classof(), clang::CXXBoolLiteralExpr::classof(), clang::ObjCAutoreleasePoolStmt::classof(), clang::CXXNullPtrLiteralExpr::classof(), clang::ObjCPropertyRefExpr::classof(), clang::DeclStmt::classof(), clang::CXXTypeidExpr::classof(), clang::NullStmt::classof(), clang::CXXUuidofExpr::classof(), clang::CompoundStmt::classof(), clang::CXXThisExpr::classof(), clang::SwitchCase::classof(), clang::CXXThrowExpr::classof(), clang::CaseStmt::classof(), clang::Expr::classof(), clang::DefaultStmt::classof(), clang::CXXDefaultArgExpr::classof(), clang::LabelStmt::classof(), clang::OpaqueValueExpr::classof(), clang::CXXBindTemporaryExpr::classof(), clang::IfStmt::classof(), clang::SwitchStmt::classof(), clang::CXXConstructExpr::classof(), clang::WhileStmt::classof(), clang::ObjCMessageExpr::classof(), clang::CXXFunctionalCastExpr::classof(), clang::DoStmt::classof(), clang::CXXTemporaryObjectExpr::classof(), clang::ObjCIsaExpr::classof(), clang::DeclRefExpr::classof(), clang::ForStmt::classof(), clang::PredefinedExpr::classof(), clang::ObjCIndirectCopyRestoreExpr::classof(), clang::GotoStmt::classof(), clang::ObjCBridgedCastExpr::classof(), clang::IndirectGotoStmt::classof(), clang::IntegerLiteral::classof(), clang::ContinueStmt::classof(), clang::BreakStmt::classof(), clang::CharacterLiteral::classof(), clang::ReturnStmt::classof(), clang::FloatingLiteral::classof(), clang::LambdaExpr::classof(), clang::ImaginaryLiteral::classof(), clang::CXXScalarValueInitExpr::classof(), clang::StringLiteral::classof(), clang::AsmStmt::classof(), clang::ParenExpr::classof(), clang::CXXNewExpr::classof(), clang::SEHExceptStmt::classof(), clang::SEHFinallyStmt::classof(), clang::CXXDeleteExpr::classof(), clang::UnaryOperator::classof(), clang::SEHTryStmt::classof(), clang::CXXPseudoDestructorExpr::classof(), clang::OffsetOfExpr::classof(), clang::UnaryTypeTraitExpr::classof(), clang::BinaryTypeTraitExpr::classof(), clang::UnaryExprOrTypeTraitExpr::classof(), clang::ArrayTypeTraitExpr::classof(), clang::ArraySubscriptExpr::classof(), clang::ExpressionTraitExpr::classof(), clang::CallExpr::classof(), clang::OverloadExpr::classof(), clang::UnresolvedLookupExpr::classof(), clang::MemberExpr::classof(), clang::CompoundLiteralExpr::classof(), clang::DependentScopeDeclRefExpr::classof(), clang::ExprWithCleanups::classof(), clang::CastExpr::classof(), clang::ImplicitCastExpr::classof(), clang::ExplicitCastExpr::classof(), clang::CXXUnresolvedConstructExpr::classof(), clang::CStyleCastExpr::classof(), clang::BinaryOperator::classof(), clang::CompoundAssignOperator::classof(), clang::CXXDependentScopeMemberExpr::classof(), clang::AbstractConditionalOperator::classof(), clang::ConditionalOperator::classof(), clang::UnresolvedMemberExpr::classof(), clang::BinaryConditionalOperator::classof(), clang::CXXNoexceptExpr::classof(), clang::AddrLabelExpr::classof(), clang::PackExpansionExpr::classof(), clang::StmtExpr::classof(), clang::ShuffleVectorExpr::classof(), clang::SizeOfPackExpr::classof(), clang::SubstNonTypeTemplateParmExpr::classof(), clang::ChooseExpr::classof(), clang::GNUNullExpr::classof(), clang::SubstNonTypeTemplateParmPackExpr::classof(), clang::VAArgExpr::classof(), clang::MaterializeTemporaryExpr::classof(), clang::InitListExpr::classof(), clang::DesignatedInitExpr::classof(), clang::ImplicitValueInitExpr::classof(), clang::ParenListExpr::classof(), clang::GenericSelectionExpr::classof(), clang::ExtVectorElementExpr::classof(), clang::BlockExpr::classof(), clang::BlockDeclRefExpr::classof(), clang::AsTypeExpr::classof(), clang::PseudoObjectExpr::classof(), clang::AtomicExpr::classof(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitSimpleStmt(), clang::CodeGen::CodeGenFunction::EmitStmt(), EvalAddr(), clang::ento::ExprEngine::evalCallee(), EvaluateStmt(), EvalVal(), GenerateMinimalPathDiagnostic(), clang::CXXNamedCastExpr::getCastName(), clang::Expr::getExprLoc(), getPrimaryDecl(), getSourceRange(), clang::CFGBlock::getTerminatorCondition(), GetUnreachableLoc(), clang::Expr::isConstantInitializer(), clang::ParentMap::isConsumedExpr(), IsGlobalLValue(), IsNested(), clang::Expr::isOBJCGCCandidate(), clang::Expr::isUnusedResultAWarning(), clang::ento::ExprEngine::MarkBranch(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), clang::TreeTransform< Derived >::TransformExpr(), clang::TreeTransform< Derived >::TransformStmt(), clang::RecursiveASTVisitor< Derived >::TraverseStmt(), clang::StmtVisitorBase< make_ptr, ASTNodeImporter, Stmt * >::Visit(), clang::CFGStmtVisitor< ImplClass, void >::VisitChildren(), clang::CFGRecStmtVisitor< ImplClass >::VisitConditionVariableInit(), clang::ento::ConditionBRVisitor::VisitTerminator(), and clang::ento::ConditionBRVisitor::VisitTrueTest().

const char * Stmt::getStmtClassName ( ) const
bool Stmt::hasImplicitControlFlow ( ) const

hasImplicitControlFlow - Some statements (e.g. short circuited operations) contain implicit control-flow in the order their subexpressions are evaluated. This predicate returns true if this statement has such implicit control-flow. Such statements are also specially handled within CFGs.

Definition at line 202 of file Stmt.cpp.

References clang::BO_Comma, clang::BinaryOperator::getOpcode(), clang::BinaryOperator::isLogicalOp(), and StmtBits.

Stmt * Stmt::IgnoreImplicit ( )

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

Reimplemented in clang::Expr.

Definition at line 88 of file Stmt.cpp.

void clang::Stmt::operator delete ( void *  data) throw () [inline, protected]

Definition at line 112 of file Stmt.h.

void clang::Stmt::operator delete ( void *  ,
ASTContext ,
unsigned   
) throw () [inline]

Definition at line 250 of file Stmt.h.

void clang::Stmt::operator delete ( void *  ,
ASTContext ,
unsigned   
) throw () [inline]

Definition at line 251 of file Stmt.h.

void clang::Stmt::operator delete ( void *  ,
std::size_t   
) throw () [inline]

Definition at line 252 of file Stmt.h.

void clang::Stmt::operator delete ( void *  ,
void *   
) throw () [inline]

Definition at line 253 of file Stmt.h.

void* clang::Stmt::operator new ( size_t  bytes) throw () [inline, protected]

Definition at line 109 of file Stmt.h.

Referenced by operator new().

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

Definition at line 236 of file Stmt.h.

References operator new().

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

Definition at line 241 of file Stmt.h.

References operator new().

void* clang::Stmt::operator new ( size_t  bytes,
void *  mem 
) throw () [inline]

Definition at line 246 of file Stmt.h.

void clang::Stmt::printPretty ( raw_ostream &  OS,
PrinterHelper Helper,
const PrintingPolicy Policy,
unsigned  Indentation = 0 
) const [inline]
void Stmt::printPretty ( raw_ostream &  OS,
ASTContext Context,
PrinterHelper Helper,
const PrintingPolicy Policy,
unsigned  Indentation = 0 
) const
void Stmt::PrintStats ( ) [static]
void Stmt::Profile ( llvm::FoldingSetNodeID &  ID,
const ASTContext Context,
bool  Canonical 
) const

Produce a unique representation of the given statement.

ID once the profiling operation is complete, will contain the unique representation of the given statement.

Context the AST context in which the statement resides

Canonical whether 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 1136 of file StmtProfile.cpp.

Referenced by checkDeducedTemplateArguments(), isSameTemplateArg(), clang::TemplateArgument::Profile(), clang::DependentSizedArrayType::Profile(), clang::DependentSizedExtVectorType::Profile(), clang::DependentTypeOfExprType::Profile(), and clang::DependentDecltypeType::Profile().

const Stmt * Stmt::stripLabelLikeStatements ( ) const

Strip off all label-like statements.

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

Definition at line 104 of file Stmt.cpp.

References S.

Referenced by stripLabelLikeStatements().

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

Definition at line 325 of file Stmt.h.

References stripLabelLikeStatements().

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

friend class ASTStmtReader [friend]

Member Data Documentation

union { ... } [protected]

Definition at line 218 of file Stmt.h.

Definition at line 225 of file Stmt.h.

Referenced by clang::CallExpr::CallExpr(), and clang::CallExpr::getNumPreArgs().

Definition at line 226 of file Stmt.h.

Referenced by clang::ExprWithCleanups::getNumObjects().

Definition at line 228 of file Stmt.h.

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

Definition at line 220 of file Stmt.h.

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


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