clang 22.0.0git
CheckerHelpers.cpp File Reference
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include <optional>
#include "clang/AST/OperationKinds.def"
#include "clang/Basic/OperatorKinds.def"

Go to the source code of this file.

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
namespace  clang::ento

Macros

#define BINARY_OPERATION(Name, Spelling)
#define UNARY_OPERATION(Name, Spelling)
#define OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly)

Functions

bool clang::ento::containsMacro (const Stmt *S)
bool clang::ento::containsEnum (const Stmt *S)
bool clang::ento::containsStaticLocal (const Stmt *S)
bool clang::ento::containsBuiltinOffsetOf (const Stmt *S)
std::pair< const clang::VarDecl *, const clang::Expr * > clang::ento::parseAssignment (const Stmt *S)
Nullability clang::ento::getNullabilityAnnotation (QualType Type)
 Get nullability annotation for a given type.
std::optional< intclang::ento::tryExpandAsInteger (StringRef Macro, const Preprocessor &PP)
 Try to parse the value of a defined preprocessor macro.
OperatorKind clang::ento::operationKindFromOverloadedOperator (OverloadedOperatorKind OOK, bool IsBinary)
std::optional< SValclang::ento::getPointeeVal (SVal PtrSVal, ProgramStateRef State)
bool clang::ento::isWithinStdNamespace (const Decl *D)
 Returns true if declaration D is in std namespace or any nested namespace or class scope.

Macro Definition Documentation

◆ BINARY_OPERATION

#define BINARY_OPERATION ( Name,
Spelling )
Value:
{Spelling, BO_##Name},

◆ OVERLOADED_OPERATOR

#define OVERLOADED_OPERATOR ( Name,
Spelling,
Token,
Unary,
Binary,
MemberOnly )
Value:
case OO_##Name: \
if (IsBinary) { \
auto BinOpIt = BinOps.find(Spelling); \
if (BinOpIt != BinOps.end()) \
return OperatorKind(BinOpIt->second); \
else \
llvm_unreachable("operator was expected to be binary but is not"); \
} else { \
auto UnOpIt = UnOps.find(Spelling); \
if (UnOpIt != UnOps.end()) \
return OperatorKind(UnOpIt->second); \
else \
llvm_unreachable("operator was expected to be unary but is not"); \
} \
break;

◆ UNARY_OPERATION

#define UNARY_OPERATION ( Name,
Spelling )
Value:
{Spelling, UO_##Name},