65#ifndef LLVM_CLANG_STATICANALYZER_UNINITIALIZEDOBJECT_H
66#define LLVM_CLANG_STATICANALYZER_UNINITIALIZEDOBJECT_H
104 void Profile(llvm::FoldingSetNodeID &
ID)
const {
ID.AddPointer(
this); }
114 return FR == OtherFR;
139 virtual void printNode(llvm::raw_ostream &Out)
const = 0;
145 virtual bool isBase()
const {
return false; }
165 FieldChain::Factory &ChainFactory;
186 bool isEmpty()
const {
return Chain.isEmpty(); }
202 bool IsAnyFieldInitialized =
false;
204 FieldChainInfo::FieldChain::Factory ChainFactory;
227 std::pair<ProgramStateRef, const UninitFieldMap &>
getResults() {
228 return {State, UninitFields};
302 bool isPrimitiveUninit(
SVal V);
336template <
class FieldNodeT>
339 "Can't add a field that is already a part of the "
340 "fieldchain! Is this a cyclic reference?");
343 NewChain.Chain = ChainFactory.add(FN, Chain);
347template <
class FieldNodeT>
350 return NewChain.
add(FN);
Represents a member of a struct/union/class.
A (possibly-)qualified type.
bool isReferenceType() const
bool isEnumeralType() const
bool isScalarType() const
bool isBuiltinType() const
Helper methods to distinguish type categories.
bool isAtomicType() const
bool isFunctionType() const
bool isVectorType() const
bool isAnyPointerType() const
Represents a field chain.
bool contains(const FieldRegion *FR) const
llvm::ImmutableList< const FieldNode & > FieldChain
FieldChainInfo(FieldChain::Factory &F)
const FieldNode & getHead() const
const FieldRegion * getUninitRegion() const
FieldChainInfo replaceHead(const FieldNodeT &FN)
Constructs a new FieldChainInfo object with FN as the new head of the list.
FieldChainInfo(const FieldChainInfo &Other)=default
FieldChainInfo add(const FieldNodeT &FN)
Constructs a new FieldChainInfo object with FN appended.
void printNoteMsg(llvm::raw_ostream &Out) const
A lightweight polymorphic wrapper around FieldRegion *.
virtual bool isBase() const
FieldNode(const FieldRegion *FR)
void Profile(llvm::FoldingSetNodeID &ID) const
virtual void printSeparator(llvm::raw_ostream &Out) const =0
Print the separator.
bool isSameRegion(const FieldRegion *OtherFR) const
Helper method for uniqueing.
const FieldRegion * getRegion() const
virtual void printPrefix(llvm::raw_ostream &Out) const =0
Print any prefixes before the fieldchain. Could contain casts, etc.
virtual void printNoteMsg(llvm::raw_ostream &Out) const =0
If this is the last element of the fieldchain, this method will print the note message associated wit...
FieldNode & operator=(const FieldNode &)=delete
FieldNode & operator=(const FieldNode &&)=delete
FieldNode(const FieldNode &)=delete
FieldNode(FieldNode &&)=delete
const FieldDecl * getDecl() const
~FieldNode()=default
FieldNodes are never meant to be created on the heap, see FindUninitializedFields::addFieldToUninits(...
virtual void printNode(llvm::raw_ostream &Out) const =0
Print the node. Should contain the name of the field stored in FR.
LLVM_ATTRIBUTE_RETURNS_NONNULL const FieldDecl * getDecl() const override
Searches for and stores uninitialized fields in a non-union object.
std::pair< ProgramStateRef, const UninitFieldMap & > getResults()
Returns with the modified state and a map of (uninitialized region, note message) pairs.
bool isAnyFieldInitialized()
Returns whether the analyzed region contains at least one initialized field.
MemRegion - The root abstract class for all memory regions.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
TypedValueRegion - An abstract class representing regions having a typed value.
std::string getVariableName(const FieldDecl *Field)
Returns with Field's name.
bool isPrimitiveType(const QualType &T)
Returns true if T is a primitive type.
bool isDereferencableType(const QualType &T)
std::map< const FieldRegion *, llvm::SmallString< 50 > > UninitFieldMap
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
@ Other
Other implicit parameter.
bool ShouldConvertNotesToWarnings
std::string IgnoredRecordsWithFieldPattern
bool CheckPointeeInitialization