mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
[analyzer] Add a helper method.
Naming could be improved.. But we should first rename the classes in the SVal hierarchy. llvm-svn: 144927
This commit is contained in:
parent
027bf11eb3
commit
af36e9128a
@ -136,6 +136,8 @@ public:
|
||||
/// return that expression. Otherwise return NULL.
|
||||
const SymExpr *getAsSymbolicExpression() const;
|
||||
|
||||
const SymExpr* getAsSymExpr() const;
|
||||
|
||||
const MemRegion *getAsRegion() const;
|
||||
|
||||
void dumpToStream(raw_ostream &OS) const;
|
||||
|
@ -114,6 +114,13 @@ const SymExpr *SVal::getAsSymbolicExpression() const {
|
||||
return getAsSymbol();
|
||||
}
|
||||
|
||||
const SymExpr* SVal::getAsSymExpr() const {
|
||||
const SymExpr* Sym = getAsSymbol();
|
||||
if (!Sym)
|
||||
Sym = getAsSymbolicExpression();
|
||||
return Sym;
|
||||
}
|
||||
|
||||
const MemRegion *SVal::getAsRegion() const {
|
||||
if (const loc::MemRegionVal *X = dyn_cast<loc::MemRegionVal>(this))
|
||||
return X->getRegion();
|
||||
|
Loading…
Reference in New Issue
Block a user