15 #ifndef LLVM_CLANG_ANALYSIS_ANALYSES_OSLOG_H 16 #define LLVM_CLANG_ANALYSIS_ANALYSES_OSLOG_H 22 namespace analyze_os_log {
74 const Expr *TheExpr =
nullptr;
82 StringRef maskType = StringRef())
83 : TheKind(kind), TheExpr(expr), Size(size), Flags(flags),
87 "unexpected privacy flag");
92 Size(Ctx.getTypeSizeInChars(Ctx.IntTy)), Flags(flags) {}
95 unsigned char result = Flags;
96 result |= ((unsigned)
getKind()) << 4;
116 enum Flags { HasPrivateItems = 1, HasNonScalarItems = 1 << 1 };
121 for (
auto &item : Items) {
141 unsigned char result = 0;
142 if (hasPrivateItems())
143 result |= HasPrivateItems;
144 if (hasNonScalarOrMask())
145 result |= HasNonScalarItems;
Defines the clang::ASTContext interface.
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.
StringRef getMaskType() const
bool computeOSLogBufferLayout(clang::ASTContext &Ctx, const clang::CallExpr *E, OSLogBufferLayout &layout)
bool hasPrivateItems() const
OSLogBufferItem(Kind kind, const Expr *expr, CharUnits size, unsigned flags, StringRef maskType=StringRef())
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.
This represents one expression.
unsigned char getSizeByte() const
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
bool hasNonScalarOrMask() 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]).