forked from OSchip/llvm-project
Pull determination of the super region for a VarRegion into a single getVarRegion() method. This provides a common clean API for clients.
llvm-svn: 58272
This commit is contained in:
parent
bc48caf383
commit
eaf5e24cbb
|
@ -430,14 +430,8 @@ public:
|
||||||
StringRegion* getStringRegion(const StringLiteral* Str);
|
StringRegion* getStringRegion(const StringLiteral* Str);
|
||||||
|
|
||||||
/// getVarRegion - Retrieve or create the memory region associated with
|
/// getVarRegion - Retrieve or create the memory region associated with
|
||||||
/// a specified VarDecl. 'superRegion' corresponds to the containing
|
/// a specified VarDecl.
|
||||||
/// memory region, and 'off' is the offset within the containing region.
|
VarRegion* getVarRegion(const VarDecl* vd);
|
||||||
VarRegion* getVarRegion(const VarDecl* vd, const MemRegion* superRegion);
|
|
||||||
|
|
||||||
VarRegion* getVarRegion(const VarDecl* vd) {
|
|
||||||
return getVarRegion(vd, vd->hasLocalStorage() ? getStackRegion()
|
|
||||||
: getGlobalsRegion());
|
|
||||||
}
|
|
||||||
|
|
||||||
ElementRegion* getElementRegion(SVal Idx, const MemRegion* superRegion);
|
ElementRegion* getElementRegion(SVal Idx, const MemRegion* superRegion);
|
||||||
|
|
||||||
|
|
|
@ -189,8 +189,11 @@ StringRegion* MemRegionManager::getStringRegion(const StringLiteral* Str) {
|
||||||
return R;
|
return R;
|
||||||
}
|
}
|
||||||
|
|
||||||
VarRegion* MemRegionManager::getVarRegion(const VarDecl* d,
|
VarRegion* MemRegionManager::getVarRegion(const VarDecl* d) {
|
||||||
const MemRegion* superRegion) {
|
|
||||||
|
const MemRegion* superRegion = d->hasLocalStorage() ? getStackRegion()
|
||||||
|
: getGlobalsRegion();
|
||||||
|
|
||||||
llvm::FoldingSetNodeID ID;
|
llvm::FoldingSetNodeID ID;
|
||||||
DeclRegion::ProfileRegion(ID, d, superRegion, MemRegion::VarRegionKind);
|
DeclRegion::ProfileRegion(ID, d, superRegion, MemRegion::VarRegionKind);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue