;
36voidSymExpr::anchor() {}
53 constllvm::APSInt &
Value) {
54 if(
Value.isUnsigned())
58 if(
Value.isUnsigned())
68os <<
'('<< ToTy <<
") (";
75 boolBinary = isa<BinarySymExpr>(Operand);
89os <<
", #"<< Count <<
'}';
105voidSymbolData::anchor() {}
112 returnitr ==
X.itr;
116 returnitr !=
X.itr;
124assert(!itr.empty() &&
"attempting to iterate on an 'end' iterator");
130assert(!itr.empty() &&
"attempting to dereference an 'end' iterator");
134voidSymExpr::symbol_iterator::expand() {
135 const SymExpr*SE = itr.pop_back_val();
138 caseSymExpr::SymbolRegionValueKind:
139 caseSymExpr::SymbolConjuredKind:
140 caseSymExpr::SymbolDerivedKind:
141 caseSymExpr::SymbolExtentKind:
142 caseSymExpr::SymbolMetadataKind:
144 caseSymExpr::SymbolCastKind:
145itr.push_back(cast<SymbolCast>(SE)->getOperand());
147 caseSymExpr::UnarySymExprKind:
148itr.push_back(cast<UnarySymExpr>(SE)->getOperand());
150 caseSymExpr::SymIntExprKind:
151itr.push_back(cast<SymIntExpr>(SE)->getLHS());
153 caseSymExpr::IntSymExprKind:
154itr.push_back(cast<IntSymExpr>(SE)->getRHS());
156 caseSymExpr::SymSymExprKind: {
157 const auto*x = cast<SymSymExpr>(SE);
158itr.push_back(x->getLHS());
159itr.push_back(x->getRHS());
163llvm_unreachable(
"unhandled expansion case");
171 returnR->getValueType();
175 ASTContext&Ctx = R->getMemRegionManager().getContext();
184 returnR->getValueType();
188 T=
T.getCanonicalType();
204 auto&dependencies = SymbolDependencies[Primary];
206dependencies = std::make_unique<SymbolRefSmallVectorTy>();
213SymbolDependTy::const_iterator I = SymbolDependencies.find(Primary);
214 if(I == SymbolDependencies.end())
216 returnI->second.get();
219voidSymbolReaper::markDependentsLive(
SymbolRefsym) {
221SymbolMapTy::iterator LI = TheLiving.find(sym);
222assert(LI != TheLiving.end() &&
"The primary symbol is not live.");
223 if(LI->second == HaveMarkedDependents)
225LI->second = HaveMarkedDependents;
228 for(
const autoI : *Deps) {
229 if(TheLiving.contains(I))
237TheLiving[sym] = NotProcessed;
238markDependentsLive(sym);
243markElementIndicesLive(region);
251 for(
autoSR = dyn_cast<SubRegion>(region); SR;
252SR = dyn_cast<SubRegion>(SR->getSuperRegion())) {
253 if(
const autoER = dyn_cast<ElementRegion>(SR)) {
254 SValIdx = ER->getIndex();
262 if(isa<SymbolMetadata>(sym))
263MetadataInUse.insert(sym);
272 if(LiveRegionRoots.count(MR))
275 if(
const auto*SR = dyn_cast<SymbolicRegion>(MR))
276 returnisLive(SR->getSymbol());
278 if(
const auto*VR = dyn_cast<VarRegion>(MR))
279 returnisLive(VR,
true);
285 returnisa<AllocaRegion, CXXThisRegion, MemSpaceRegion, CodeTextRegion>(MR);
288boolSymbolReaper::isLazilyCopiedRegion(
const MemRegion*MR)
const{
293boolSymbolReaper::isReadableRegion(
const MemRegion*MR) {
294 returnisLiveRegion(MR) || isLazilyCopiedRegion(MR);
298 if(TheLiving.count(sym)) {
299markDependentsLive(sym);
306 caseSymExpr::SymbolRegionValueKind:
307KnownLive = isReadableRegion(cast<SymbolRegionValue>(sym)->
getRegion());
309 caseSymExpr::SymbolConjuredKind:
312 caseSymExpr::SymbolDerivedKind:
313KnownLive = isLive(cast<SymbolDerived>(sym)->getParentSymbol());
315 caseSymExpr::SymbolExtentKind:
316KnownLive = isLiveRegion(cast<SymbolExtent>(sym)->
getRegion());
318 caseSymExpr::SymbolMetadataKind:
319KnownLive = MetadataInUse.count(sym) &&
320isLiveRegion(cast<SymbolMetadata>(sym)->
getRegion());
322MetadataInUse.erase(sym);
324 caseSymExpr::SymIntExprKind:
325KnownLive = isLive(cast<SymIntExpr>(sym)->getLHS());
327 caseSymExpr::IntSymExprKind:
328KnownLive = isLive(cast<IntSymExpr>(sym)->getRHS());
330 caseSymExpr::SymSymExprKind:
331KnownLive = isLive(cast<SymSymExpr>(sym)->getLHS()) &&
332isLive(cast<SymSymExpr>(sym)->getRHS());
334 caseSymExpr::SymbolCastKind:
335KnownLive = isLive(cast<SymbolCast>(sym)->getOperand());
337 caseSymExpr::UnarySymExprKind:
338KnownLive = isLive(cast<UnarySymExpr>(sym)->getOperand());
350 if(LCtx ==
nullptr)
356 if(LCtx->isParentOf(ELCtx))
379 if(VarContext == CurrentContext) {
386 if(isa<CXXInheritedCtorInitExpr>(
Loc))
392 if(!includeStoreBindings)
395 unsigned&cachedQuery =
396 const_cast<SymbolReaper*
>(
this)->includedRegionCache[VR];
399 returncachedQuery == 1;
403 if(
Storestore = reapedStore.getStore()) {
405reapedStore.getStoreManager().includedInBindings(store, VR);
406cachedQuery = hasRegion ? 1 : 2;
413 returnVarContext->
isParentOf(CurrentContext);
Defines the clang::ASTContext interface.
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
static const MemRegion * getRegion(const CallEvent &Call, const MutexDescriptor &Descriptor, bool IsLock)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the Objective-C statement AST node classes.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
StringRef getOpcodeStr() const
ASTContext & getASTContext() const LLVM_READONLY
This represents one expression.
bool isLive(const CFGBlock *B, const VarDecl *D)
Return true if a variable is live at the end of a specified block.
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...
bool isParentOf(const LocationContext *LC) const
const Decl * getDecl() const
const StackFrameContext * getStackFrame() const
A (possibly-)qualified type.
It represents a stack frame of the call stack (based on CallEvent).
int64_t getID(const ASTContext &Context) const
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
bool isRecordType() const
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
static void dumpToStreamImpl(raw_ostream &os, const SymExpr *Value)
static bool isLocType(QualType T)
MemRegion - The root abstract class for all memory regions.
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * getBaseRegion() const
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
llvm::iterator_range< SymExpr::symbol_iterator > symbols() const
Iterator over symbols that the current symbol depends on.
symbol_iterator()=default
bool operator!=(const symbol_iterator &X) const
symbol_iterator & operator++()
bool operator==(const symbol_iterator &X) const
const SymExpr * operator*()
virtual void dumpToStream(raw_ostream &os) const
virtual void dump() const
SymbolID getSymbolID() const
Get a unique identifier for this symbol.
void dumpToStream(raw_ostream &os) const override
StringRef getKindStr() const override
Get a string representation of the kind of the region.
void dumpToStream(raw_ostream &os) const override
QualType getType() const override
LLVM_ATTRIBUTE_RETURNS_NONNULL SymbolRef getParentSymbol() const
StringRef getKindStr() const override
Get a string representation of the kind of the region.
void dumpToStream(raw_ostream &os) const override
QualType getType() const override
LLVM_ATTRIBUTE_RETURNS_NONNULL const TypedValueRegion * getRegion() const
LLVM_ATTRIBUTE_RETURNS_NONNULL const SubRegion * getRegion() const
void dumpToStream(raw_ostream &os) const override
QualType getType() const override
StringRef getKindStr() const override
Get a string representation of the kind of the region.
void addSymbolDependency(const SymbolRef Primary, const SymbolRef Dependent)
Add artificial symbol dependency.
const SymbolRefSmallVectorTy * getDependentSymbols(const SymbolRef Primary)
static bool canSymbolicate(QualType T)
A class responsible for cleaning up unused symbols.
void markLive(SymbolRef sym)
Unconditionally marks a symbol as live.
void markElementIndicesLive(const MemRegion *region)
void markInUse(SymbolRef sym)
Marks a symbol as important to a checker.
bool isLiveRegion(const MemRegion *region)
void markLazilyCopied(const MemRegion *region)
bool isLive(SymbolRef sym)
void dumpToStream(raw_ostream &os) const override
QualType getType() const override
StringRef getKindStr() const override
Get a string representation of the kind of the region.
void dumpToStream(raw_ostream &os) const override
const VarDecl * getDecl() const override=0
const StackFrameContext * getStackFrame() const
It might return null.
@ OS
Indicates that the tracking object is a descendant of a referenced-counted OSObject,...
const void * Store
Store - This opaque type encapsulates an immutable mapping from locations to values.
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4