15 #ifndef LLVM_CLANG_ANALYSIS_ANALYSES_OSLOG_H 16 #define LLVM_CLANG_ANALYSIS_ANALYSES_OSLOG_H 22 namespace analyze_os_log {
68 const Expr *TheExpr =
nullptr;
75 : TheKind(kind), TheExpr(expr), Size(size), Flags(flags) {}
79 Size(Ctx.getTypeSizeInChars(Ctx.IntTy)), Flags(flags) {}
82 unsigned char result = 0;
87 result |= ((unsigned)
getKind()) << 4;
106 enum Flags { HasPrivateItems = 1, HasNonScalarItems = 1 << 1 };
111 for (
auto &item : Items) {
135 unsigned char result = 0;
136 if (hasPrivateItems())
137 result |= HasPrivateItems;
139 result |= HasNonScalarItems;
Defines the clang::ASTContext interface.
bool hasPublicItems() const
unsigned char getDescriptorByte() const
unsigned char getSummaryByte() const
OSLogBufferItem(ASTContext &Ctx, CharUnits value, unsigned flags)
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const Expr * getExpr() const
unsigned char getNumArgsByte() const
CharUnits - This is an opaque type for sizes expressed in character units.
bool computeOSLogBufferLayout(clang::ASTContext &Ctx, const clang::CallExpr *E, OSLogBufferLayout &layout)
bool hasPrivateItems() const
An OSLogBufferItem represents a single item in the data written by a call to os_log() or os_trace()...
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Expr - This represents one expression.
unsigned char getSizeByte() const
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
bool hasNonScalar() const
CharUnits getConstValue() const
Dataflow Directional Tag Classes.
SmallVector< OSLogBufferItem, 4 > Items
bool getIsPrivate() const
unsigned kind
All of the diagnostics that can be emitted by the frontend.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
OSLogBufferItem(Kind kind, const Expr *expr, CharUnits size, unsigned flags)