clang 22.0.0git
Stmt.cpp File Reference
#include "clang/AST/Stmt.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclGroup.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprConcepts.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/ExprOpenMP.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtObjC.h"
#include "clang/AST/StmtOpenACC.h"
#include "clang/AST/StmtOpenMP.h"
#include "clang/AST/StmtSYCL.h"
#include "clang/AST/Type.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Token.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstring>
#include <optional>
#include <string>
#include <utility>
#include "clang/AST/StmtNodes.inc"

Go to the source code of this file.

Classes

struct  StmtClassNameTable

Macros

#define STMT(CLASS, PARENT)
#define STMT_RANGE(BASE, FIRST, LAST)
#define LAST_STMT_RANGE(BASE, FIRST, LAST)
#define ABSTRACT_STMT(STMT)
#define ABSTRACT_STMT(STMT)
#define STMT(CLASS, PARENT)
#define STMT(CLASS, PARENT)
#define STMT(CLASS, PARENT)
#define INITLISTEXPR(CLASS, PARENT)
#define ASSERT_IMPLEMENTS_children(type)
#define ASSERT_IMPLEMENTS_getBeginLoc(type)
#define ASSERT_IMPLEMENTS_getEndLoc(type)
#define ABSTRACT_STMT(type)
#define STMT(type, base)
#define ABSTRACT_STMT(type)
#define STMT(type, base)
#define ABSTRACT_STMT(type)
#define STMT(type, base)
#define ABSTRACT_STMT(type)
#define STMT(type, base)
#define ABSTRACT_STMT(type)
#define STMT(type, base)

Functions

static StmtClassNameTablegetStmtInfoTableEntry (Stmt::StmtClass E)
static std::pair< Stmt::Likelihood, const Attr * > getLikelihood (ArrayRef< const Attr * > Attrs)
static std::pair< Stmt::Likelihood, const Attr * > getLikelihood (const Stmt *S)
static LLVM_ATTRIBUTE_UNUSED void check_implementations ()
 Check whether the various Stmt classes implement their member functions.
static StringRef copyIntoContext (const ASTContext &C, StringRef str)

Variables

static struct StmtClassNameTable StmtClassInfo [Stmt::lastStmtConstant+1]

Macro Definition Documentation

◆ ABSTRACT_STMT [1/7]

#define ABSTRACT_STMT ( STMT)

Definition at line 57 of file Stmt.cpp.

◆ ABSTRACT_STMT [2/7]

#define ABSTRACT_STMT ( STMT)

Definition at line 57 of file Stmt.cpp.

◆ ABSTRACT_STMT [3/7]

#define ABSTRACT_STMT ( type)

Definition at line 57 of file Stmt.cpp.

◆ ABSTRACT_STMT [4/7]

#define ABSTRACT_STMT ( type)

Definition at line 57 of file Stmt.cpp.

◆ ABSTRACT_STMT [5/7]

#define ABSTRACT_STMT ( type)

Definition at line 57 of file Stmt.cpp.

◆ ABSTRACT_STMT [6/7]

#define ABSTRACT_STMT ( type)

Definition at line 57 of file Stmt.cpp.

◆ ABSTRACT_STMT [7/7]

#define ABSTRACT_STMT ( type)

Definition at line 57 of file Stmt.cpp.

◆ ASSERT_IMPLEMENTS_children

#define ASSERT_IMPLEMENTS_children ( type)
Value:
(void) is_good(implements_children(&type::children))

Definition at line 274 of file Stmt.cpp.

◆ ASSERT_IMPLEMENTS_getBeginLoc

#define ASSERT_IMPLEMENTS_getBeginLoc ( type)
Value:
(void)is_good(implements_getBeginLoc(&type::getBeginLoc))

Definition at line 276 of file Stmt.cpp.

◆ ASSERT_IMPLEMENTS_getEndLoc

#define ASSERT_IMPLEMENTS_getEndLoc ( type)
Value:
(void)is_good(implements_getEndLoc(&type::getEndLoc))

Definition at line 278 of file Stmt.cpp.

◆ INITLISTEXPR

#define INITLISTEXPR ( CLASS,
PARENT )

Definition at line 106 of file Stmt.cpp.

◆ LAST_STMT_RANGE

#define LAST_STMT_RANGE ( BASE,
FIRST,
LAST )
Value:
static_assert(llvm::isUInt<NumStmtBits>(Stmt::StmtClass::LAST##Class), \
"The number of 'StmtClass'es is strictly bound " \
"by a bitfield of width NumStmtBits");

Definition at line 53 of file Stmt.cpp.

◆ STMT [1/9]

#define STMT ( CLASS,
PARENT )

Definition at line 51 of file Stmt.cpp.

◆ STMT [2/9]

#define STMT ( CLASS,
PARENT )
Value:
StmtClassInfo[(unsigned)Stmt::CLASS##Class].Name = #CLASS; \
StmtClassInfo[(unsigned)Stmt::CLASS##Class].Size = sizeof(CLASS);
static struct StmtClassNameTable StmtClassInfo[Stmt::lastStmtConstant+1]

Definition at line 51 of file Stmt.cpp.

◆ STMT [3/9]

#define STMT ( CLASS,
PARENT )
Value:
static_assert(!std::is_polymorphic<CLASS>::value, \
#CLASS " should not be polymorphic!");

Definition at line 51 of file Stmt.cpp.

◆ STMT [4/9]

#define STMT ( CLASS,
PARENT )
Value:
static_assert(std::is_trivially_destructible<CLASS>::value, \
#CLASS " should be trivially destructible!");

Definition at line 51 of file Stmt.cpp.

◆ STMT [5/9]

#define STMT ( type,
base )
Value:
ASSERT_IMPLEMENTS_getBeginLoc(type); \
ASSERT_IMPLEMENTS_getEndLoc(type);
#define ASSERT_IMPLEMENTS_children(type)
Definition Stmt.cpp:274
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.

Definition at line 51 of file Stmt.cpp.

◆ STMT [6/9]

#define STMT ( type,
base )
Value:
case Stmt::type##Class: \
return static_cast<type*>(this)->children();

Definition at line 51 of file Stmt.cpp.

◆ STMT [7/9]

#define STMT ( type,
base )
Value:
case Stmt::type##Class: \
return getSourceRangeImpl<type>(this, &type::getSourceRange);

Definition at line 51 of file Stmt.cpp.

◆ STMT [8/9]

#define STMT ( type,
base )
Value:
case Stmt::type##Class: \
return static_cast<const type *>(this)->getBeginLoc();

Definition at line 51 of file Stmt.cpp.

◆ STMT [9/9]

#define STMT ( type,
base )
Value:
case Stmt::type##Class: \
return static_cast<const type *>(this)->getEndLoc();

Definition at line 51 of file Stmt.cpp.

◆ STMT_RANGE

#define STMT_RANGE ( BASE,
FIRST,
LAST )

Definition at line 52 of file Stmt.cpp.

Function Documentation

◆ check_implementations()

LLVM_ATTRIBUTE_UNUSED void check_implementations ( )
inlinestatic

Check whether the various Stmt classes implement their member functions.

Definition at line 286 of file Stmt.cpp.

◆ copyIntoContext()

StringRef copyIntoContext ( const ASTContext & C,
StringRef str )
static

Definition at line 931 of file Stmt.cpp.

References clang::C.

◆ getLikelihood() [1/2]

std::pair< Stmt::Likelihood, const Attr * > getLikelihood ( ArrayRef< const Attr * > Attrs)
static

Definition at line 144 of file Stmt.cpp.

References clang::isa(), clang::Stmt::LH_Likely, clang::Stmt::LH_None, and clang::Stmt::LH_Unlikely.

Referenced by getLikelihood().

◆ getLikelihood() [2/2]

std::pair< Stmt::Likelihood, const Attr * > getLikelihood ( const Stmt * S)
static

Definition at line 156 of file Stmt.cpp.

References getLikelihood(), and clang::Stmt::LH_None.

◆ getStmtInfoTableEntry()

StmtClassNameTable & getStmtInfoTableEntry ( Stmt::StmtClass E)
static

Variable Documentation

◆ StmtClassInfo

struct StmtClassNameTable StmtClassInfo[Stmt::lastStmtConstant+1]
static