Go to the documentation of this file.
14 #ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_VALUE_H
15 #define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_VALUE_H
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/StringMap.h"
21 #include "llvm/ADT/StringRef.h"
47 virtual ~Value() =
default;
86 RightSubVal(RightSubVal) {}
108 RightSubVal(RightSubVal) {}
157 :
Value(ValueKind), PointeeLoc(PointeeLoc) {}
199 explicit StructValue(llvm::DenseMap<const ValueDecl *, Value *> Children)
209 auto It = Children.find(&D);
210 if (It == Children.end())
221 auto It = Properties.find(Name);
222 return It == Properties.end() ? nullptr : It->second;
228 Properties.insert_or_assign(Name, &Val);
232 llvm::DenseMap<const ValueDecl *, Value *> Children;
233 llvm::StringMap<Value *> Properties;
239 #endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_VALUE_H
static bool classof(const Value *Val)
YAML serialization mapping.
Value * getChild(const ValueDecl &D) const
Returns the child value that is assigned for D or null if the child is not initialized.
static bool classof(const Value *Val)
Base class for values that refer to storage locations.
ReferenceValue(StorageLocation &PointeeLoc)
Base class for elements of the local variable store and of the heap.
static bool classof(const Value *Val)
@ Reference
An optional reference should be skipped past.
Models a boolean disjunction.
Value * getProperty(llvm::StringRef Name) const
Returns the value of the synthetic property with the given Name or null if the property isn't assigne...
BoolValue & getLeftSubValue() const
Returns the left sub-value of the disjunction.
Models a boolean conjunction.
StorageLocation & getPointeeLoc() const
static bool classof(const Value *Val)
static bool classof(const Value *Val)
Models an atomic boolean.
void setChild(const ValueDecl &D, Value &Val)
Assigns Val as the child value for D.
static bool classof(const Value *Val)
BoolValue(Kind ValueKind)
IndirectionValue(Kind ValueKind, StorageLocation &PointeeLoc)
Constructs a value that refers to PointeeLoc.
BoolValue & getLeftSubValue() const
Returns the left sub-value of the conjunction.
ConjunctionValue(BoolValue &LeftSubVal, BoolValue &RightSubVal)
Models a dereferenced pointer.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
PointerValue(StorageLocation &PointeeLoc)
Models a boolean negation.
static bool classof(const Value *Val)
NegationValue(BoolValue &SubVal)
StructValue(llvm::DenseMap< const ValueDecl *, Value * > Children)
BoolValue & getRightSubValue() const
Returns the right sub-value of the conjunction.
BoolValue & getRightSubValue() const
Returns the right sub-value of the disjunction.
static bool classof(const Value *Val)
Models a value of struct or class type, with a flat map of fields to child storage locations,...
DisjunctionValue(BoolValue &LeftSubVal, BoolValue &RightSubVal)
Base class for all values computed by abstract interpretation.
void setProperty(llvm::StringRef Name, Value &Val)
Assigns Val as the value of the synthetic property with the given Name.
static bool classof(const Value *Val)
Models a symbolic pointer. Specifically, any value of type T*.
BoolValue & getSubVal() const
Returns the sub-value of the negation.
static bool classof(const Value *Val)