59 #ifndef LLVM_CLANG_STATICANALYZER_UNINITIALIZEDOBJECT_H 60 #define LLVM_CLANG_STATICANALYZER_UNINITIALIZEDOBJECT_H 97 void Profile(llvm::FoldingSetNodeID &
ID)
const { ID.AddPointer(
this); }
107 return FR == OtherFR;
126 virtual void printNoteMsg(llvm::raw_ostream &Out)
const = 0;
129 virtual void printPrefix(llvm::raw_ostream &Out)
const = 0;
132 virtual void printNode(llvm::raw_ostream &Out)
const = 0;
136 virtual void printSeparator(llvm::raw_ostream &Out)
const = 0;
138 virtual bool isBase()
const {
return false; }
158 FieldChain::Factory &ChainFactory;
172 template <
class FieldNodeT>
FieldChainInfo add(
const FieldNodeT &FN);
176 template <
class FieldNodeT>
FieldChainInfo replaceHead(
const FieldNodeT &FN);
179 bool isEmpty()
const {
return Chain.isEmpty(); }
184 void printNoteMsg(llvm::raw_ostream &Out)
const;
195 bool IsAnyFieldInitialized =
false;
197 FieldChainInfo::FieldChain::Factory ChainFactory;
220 std::pair<ProgramStateRef, const UninitFieldMap &>
getResults() {
221 return {
State, UninitFields};
295 bool isPrimitiveUninit(
const SVal &V);
329 template <
class FieldNodeT>
331 assert(!contains(FN.getRegion()) &&
332 "Can't add a field that is already a part of the " 333 "fieldchain! Is this a cyclic reference?");
336 NewChain.Chain = ChainFactory.add(FN, Chain);
340 template <
class FieldNodeT>
343 return NewChain.
add(FN);
349 #endif // LLVM_CLANG_STATICANALYZER_UNINITIALIZEDOBJECT_H
TypedValueRegion - An abstract class representing regions having a typed value.
std::string IgnoredRecordsWithFieldPattern
A (possibly-)qualified type.
MemRegion - The root abstract class for all memory regions.
bool isBlockPointerType() const
bool isSameRegion(const FieldRegion *OtherFR) const
Helper method for uniqueing.
bool isMemberPointerType() const
bool ShouldConvertNotesToWarnings
const FieldRegion * getUninitRegion() const
FieldChainInfo(FieldChain::Factory &F)
bool isPrimitiveType(const QualType &T)
Returns true if T is a primitive type.
bool isAnyFieldInitialized()
Returns whether the analyzed region contains at least one initialized field.
bool isEnumeralType() const
FieldChainInfo add(const FieldNodeT &FN)
Constructs a new FieldChainInfo object with FN appended.
const FieldDecl * getDecl() const
const FieldNode & getHead() const
Represents a member of a struct/union/class.
bool isReferenceType() const
FieldNode(const FieldRegion *FR)
bool isDereferencableType(const QualType &T)
bool CheckPointeeInitialization
std::string getVariableName(const FieldDecl *Field)
Returns with Field's name.
Searches for and stores uninitialized fields in a non-union object.
void Profile(llvm::FoldingSetNodeID &ID) const
bool isBuiltinType() const
Helper methods to distinguish type categories.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
bool isAnyPointerType() const
virtual bool isBase() const
Represents a field chain.
Dataflow Directional Tag Classes.
const FieldDecl * getDecl() const
llvm::ImmutableList< const FieldNode & > FieldChain
std::map< const FieldRegion *, llvm::SmallString< 50 > > UninitFieldMap
bool isFunctionType() const
FieldChainInfo replaceHead(const FieldNodeT &FN)
Constructs a new FieldChainInfo object with FN as the new head of the list.
A lightweight polymorphic wrapper around FieldRegion *.
std::pair< ProgramStateRef, const UninitFieldMap & > getResults()
Returns with the modified state and a map of (uninitialized region, note message) pairs...
const FieldRegion * getRegion() const