14 #ifndef LLVM_CLANG_ANALYSIS_ANALYSES_OSLOG_H 15 #define LLVM_CLANG_ANALYSIS_ANALYSES_OSLOG_H 21 namespace analyze_os_log {
73 const Expr *TheExpr =
nullptr;
81 StringRef maskType = StringRef())
82 : TheKind(kind), TheExpr(expr), Size(size), Flags(flags),
86 "unexpected privacy flag");
91 Size(Ctx.getTypeSizeInChars(Ctx.IntTy)), Flags(flags) {}
94 unsigned char result = Flags;
95 result |= ((unsigned)
getKind()) << 4;
115 enum Flags { HasPrivateItems = 1, HasNonScalarItems = 1 << 1 };
120 for (
auto &item : Items) {
140 unsigned char result = 0;
141 if (hasPrivateItems())
142 result |= HasPrivateItems;
143 if (hasNonScalarOrMask())
144 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]).