Get desktop application:
View/edit binary Protocol Buffers messages
Used in:
Encodes properties of an assignment relevant to collecting evidence for the assignment's LHS; that is, the assignee.
Used in:
Genuinely optional: not populated when RHS is a nullptr literal.
Covers argument binding and "binding" to the returned value.
Used in:
Whether the type is: a) a reference, and ...
b) const, after stripping any reference qualifier.
Genuinely optional: not populated when the value is a nullptr literal.
Summarizes Nullability-relevant "behaviors" and relevant context from a CFG.
Used in:
An observation of nullability based on local analysis (e.g. a function body). Evidence from across different functions/TUs is combined to form conclusions.
Used in: ,
Source location: file:line:col. Optional, for debugging only.
If set, this evidence was originally collected from the virtual or override function identified by this symbol and propagated to `symbol`.
A pattern in the code that might help us determine nullability.
Used in: , ,
The declaration was annotated with _Null_unspecified or similar.
The declaration was annotated with _Nullable or similar.
The declaration was annotated with _Nonnull or similar.
A pointer was dereferenced without being checked for null first.
A Nullable value was passed as an argument.
A Nonnull value was passed as an argument.
A value with Unknown nullability was passed as an argument.
A Nullable value was returned.
A Nonnull value was returned.
A value with Unknown nullability was returned.
A value was assigned to a Nonnull declaration. e.g. evidence for `p` from `int* _Nonnull q = p;`.
A value was assigned to a declaration that is a reference to a mutable nullable pointer, e.g. evidence for `p` from `int* _Nullable& q = p;`.
The program aborts if a value is null.
A nullable value was assigned. e.g. evidence for `p` from `int* p = nullptr;`.
A pointer was used with an arithmetic operator without being checked for null first.
A non-static member variable has a default initializer that is a literal nullptr or is simply constructed from a literal nullptr. This is considered to be a weaker signal than other assignments to nullable, due to the common use of nullptr as a default value to avoid quieter uninitialized memory errors in favor of loud segfaults, so we differentiate the evidence. Default initializers that are nullable but not using literal nullptrs use the stronger evidence ASSIGNED_TO_NULLABLE, as they likely indicate more explicit Nullable intent.
__attribute((nonnull[(optional_param_indices)])) was applied to a function or parameter declaration or __attribute((returns_nonnull)) was applied to a function declaration.
A Nullable value was returned as a reference.
A Nonnull value was returned as a mutable reference.
A value with Unknown nullability was returned as a reference.
A Nullable value was passed as a reference argument.
A Nonnull value was passed as a mutable reference argument.
A value with Unknown nullability was passed as a reference argument.
A nonnull value was assigned. e.g. evidence for `p` from `int a; int* p = &a;`.
An unknown value was assigned. e.g. evidence for `p` from `int* p = getUnknownPtr();`.
A value was bound to a reference to a nonnull pointer, regardless of whether the pointer can be mutated through the reference. If any Nonnull reference exists, the pointer must be declared Nonnull to prevent the pointer from being directly, or through a different reference, assigned to null and then accessed through the Nonnull reference unsafely. e.g. evidence for `p` from `int* _Nonnull&q = p;`.
A reference to a nonnull value was returned as a reference to a const value. This is distinct from NONNULL_REFERENCE_RETURN because it does not require that the return type is Nonnull, the way returning a reference to a mutable nonnull value does.
A reference to a nonnull value was passed as an argument to a const reference parameter. This is distinct from NONNULL_REFERENCE_ARGUMENT because it does not require that the argument type is Nonnull, the way passing a reference to a mutable nonnull value does.
A decl that is defined by the standard or strong convention to be Nonnull.
A decl that is defined by the standard or strong convention to be Nullable.
A pointer was used with an array subscript operator without being checked for null first.
A smart pointer field was left not-nullable in the exit block of a supported late initializer method.
A smart pointer field was left default-initialized (to null) or initialized to a nullable value in the exit block of a constructor.
Covers behaviors learned specifically from particular function exit blocks -- constructors and (late) initializers.
Used in:
Encodes type Formula.
Used in: , , ,
A compact serialization of a formula. Serialization and deserialization (parsing) is handled by the dataflow framework. The grammar is: bool ::= "F" (false) | "T" (true) atom ::= "V" n (n is a positive integer) op ::= "&" (and) | "|" (or) | ">" (implication) | "=" (equality) F ::= bool | atom | "!" F | op F1 F2 The corresponding serialization/deserialization API is https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Analysis/FlowSensitive/FormulaSerialization.h
Used in:
For initialization functions -- constructors and "late" initializers -- we collect the state of fields at function exit. We may judge the nullability of the field based on this exit state rather than strictly on initial state.
Used in:
The logical context for a function definition.
Used in:
optional, string-encoded formula providing an invariant across all formulas represented in this logical context.
Int-encoded atoms and their definitions as formulas.
The dependencies of the atoms used in the function. The key is the atom, and the value is the set of atoms that the key atom depends on.
Used in:
Used in: , , ,
Used in:
The numerical ID of the atom representing the flow condition (aka. flow condition token) of the block from which this behavior was summarized.
Encodes type PointerNullState.
Used in: , , ,
Both fields are optional.
Encodes type PointerTypeNullability.
Used in: ,
Used in:
A generic serialization format for a relation between symbols. Currently, used as for the `RelatedVirtualMethodsMap` type. TODO: b/440317964 - design a compact representation. For example, we could represent Symbols by integers, and separately maintain a map from integers to USRs.
Used in:
Since map keys cannot be message fields, we use strings directly for the key. These must be USRs.
Used in:
A half-open source range to be removed: [begin, end).
Used in:
Encodes a potential requirement for an annotation, specifically -- when `formula` is true in the surrounding context.
Used in:
In practice, only Nonnull or Nullable make sense for this field.
A "slot" identifies a position in a symbol's type that may have nullability. We use uint32 rather than the Slot type to represent slot numbers in protos. (A symbol may have any number of slots, and proto2 enums are closed). The Slot enum only defines well-known slot values for functions. Fields and global variables use Slot numbers aligned with the indices of their nullability vectors.
The slot number for a function's return type.
The slot number for a function's first parameter. The second param is SLOT_PARAM + 1, etc.
A conclusion about nullability based on global analysis (e.g. all TUs).
Indicates that not we could not reconcile all evidence into a conclusion. e.g. a decl that was both unconditionally dereferenced and assigned null.
Examples of evidence that contributed. Optional, for debugging only.
Indicates that this inference does not represent new information beyond what is explicitly written in the source code, and so does not need to be separately propagated from one round of inference into the next. e.g. an inference gathered from ANNOTATED_NONNULL Evidence.
Slot identifiers for which this inference is applicable. Used only for debugging information.
Summary of an incomplete set of Evidence for a slot. Once all evidence has been incorporated, can be finalized into SlotInference. This type should be treated as opaque, and its serialization is not stable.
Slot identifiers for which this partial is relevant. Used only for debugging information.
Used in:
A bounded number of evidence pieces are stored.
Nullability information for a pointer-type source range. Does not include the full source range for the type, as that isn't needed for adding/removing nullability annotations.
Path of the file containing this range.
The nullability default set by the pragma affecting `path`, if one exists.
The offset at which a qualifier-position annotation should be inserted. For a named pointer type not ending with `*`, including smart pointers and aliases to raw pointers, this precedes the type but follows any cv-qualifiers. For other pointers, this follows the `*` but precedes any cv-qualifiers. This field uniquely identifies a pointer-type slot range within a file, as no two pointer ranges can be annotated with a qualifier-positioned annotation in the same location.
The source ranges of existing annotations to be removed if modifying the annotation for this range.
A symbol whose nullability should potentially be inferred.
Used in: , , , ,
Clang "Unified Symbol Resolution" identifier for the symbol.
A summary for a whole translation unit.
Information about the TU that could be useful for debug logs.
Encodes properties of an assignment relevant to collecting evidence for the assignment's RHS.
Used in:
optional. When a decl is available for the LHS, lhs_type_nullability may be overridden during inference. `fingerprint` identifies this decl. When populated, the fingerprint should be checked for an override.
This field is genuinely optional and should be provided only if the LHS has reference type.