[cfe-commits] r74521 - in /cfe/trunk: include/clang/Analysis/PathSensitive/SVals.h lib/Analysis/SVals.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Tue Jun 30 04:52:41 PDT 2009
Author: zhongxingxu
Date: Tue Jun 30 06:52:40 2009
New Revision: 74521
URL: http://llvm.org/viewvc/llvm-project?rev=74521&view=rev
Log:
add utility method.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
cfe/trunk/lib/Analysis/SVals.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h?rev=74521&r1=74520&r2=74521&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h Tue Jun 30 06:52:40 2009
@@ -110,6 +110,8 @@
/// getAsSymbolicExpression - If this Sval wraps a symbolic expression then
/// return that expression. Otherwise return NULL.
const SymExpr *getAsSymbolicExpression() const;
+
+ const MemRegion *getAsRegion() const;
void print(llvm::raw_ostream& OS) const;
void printStdErr() const;
Modified: cfe/trunk/lib/Analysis/SVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SVals.cpp?rev=74521&r1=74520&r2=74521&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/SVals.cpp (original)
+++ cfe/trunk/lib/Analysis/SVals.cpp Tue Jun 30 06:52:40 2009
@@ -114,6 +114,13 @@
return getAsSymbol();
}
+const MemRegion *SVal::getAsRegion() const {
+ if (const loc::MemRegionVal *X = dyn_cast<loc::MemRegionVal>(this))
+ return X->getRegion();
+
+ return 0;
+}
+
bool SVal::symbol_iterator::operator==(const symbol_iterator &X) const {
return itr == X.itr;
}
More information about the cfe-commits
mailing list