forked from OSchip/llvm-project
Added batch versions of GRState::scanReachableSymbols() so that clients can scan a collection of SVals or MemRegions all at once.
llvm-svn: 89926
This commit is contained in:
parent
c778540f9a
commit
705fd953ef
|
@ -265,7 +265,20 @@ public:
|
|||
|
||||
bool scanReachableSymbols(SVal val, SymbolVisitor& visitor) const;
|
||||
|
||||
bool scanReachableSymbols(const SVal *I, const SVal *E,
|
||||
SymbolVisitor &visitor) const;
|
||||
|
||||
bool scanReachableSymbols(const MemRegion * const *I,
|
||||
const MemRegion * const *E,
|
||||
SymbolVisitor &visitor) const;
|
||||
|
||||
template <typename CB> CB scanReachableSymbols(SVal val) const;
|
||||
template <typename CB> CB scanReachableSymbols(const SVal *beg,
|
||||
const SVal *end) const;
|
||||
|
||||
template <typename CB> CB
|
||||
scanReachableSymbols(const MemRegion * const *beg,
|
||||
const MemRegion * const *end) const;
|
||||
|
||||
//==---------------------------------------------------------------------==//
|
||||
// Accessing the Generic Data Map (GDM).
|
||||
|
@ -727,6 +740,20 @@ CB GRState::scanReachableSymbols(SVal val) const {
|
|||
return cb;
|
||||
}
|
||||
|
||||
template <typename CB>
|
||||
CB GRState::scanReachableSymbols(const SVal *beg, const SVal *end) const {
|
||||
CB cb(this);
|
||||
scanReachableSymbols(beg, end, cb);
|
||||
return cb;
|
||||
}
|
||||
|
||||
template <typename CB>
|
||||
CB GRState::scanReachableSymbols(const MemRegion * const *beg,
|
||||
const MemRegion * const *end) const {
|
||||
CB cb(this);
|
||||
scanReachableSymbols(beg, end, cb);
|
||||
return cb;
|
||||
}
|
||||
} // end clang namespace
|
||||
|
||||
#endif
|
||||
|
|
|
@ -308,6 +308,27 @@ bool GRState::scanReachableSymbols(SVal val, SymbolVisitor& visitor) const {
|
|||
return S.scan(val);
|
||||
}
|
||||
|
||||
bool GRState::scanReachableSymbols(const SVal *I, const SVal *E,
|
||||
SymbolVisitor &visitor) const {
|
||||
ScanReachableSymbols S(this, visitor);
|
||||
for ( ; I != E; ++I) {
|
||||
if (S.scan(*I))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GRState::scanReachableSymbols(const MemRegion * const *I,
|
||||
const MemRegion * const *E,
|
||||
SymbolVisitor &visitor) const {
|
||||
ScanReachableSymbols S(this, visitor);
|
||||
for ( ; I != E; ++I) {
|
||||
if (S.scan(*I))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Queries.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
Loading…
Reference in New Issue