about summary refs log tree commit diff homepage
path: root/lib/Core/Memory.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-04 08:31:20 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-04 08:31:20 +0000
commitf870aa1e0723e9203df495020ee2bf2bc47a6246 (patch)
treed15a78c7c6f4106ce141fc92c8dce5dc8217bd84 /lib/Core/Memory.cpp
parent44e3d58b59099f5fd0e6f88893ce431171b3fef6 (diff)
downloadklee-f870aa1e0723e9203df495020ee2bf2bc47a6246.tar.gz
Finish removing uses of Expr::isConstant.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Core/Memory.cpp')
-rw-r--r--lib/Core/Memory.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Core/Memory.cpp b/lib/Core/Memory.cpp
index b4c433b1..5a3af34c 100644
--- a/lib/Core/Memory.cpp
+++ b/lib/Core/Memory.cpp
@@ -301,7 +301,7 @@ ref<Expr> ObjectState::read8(unsigned offset) const {
 }
 
 ref<Expr> ObjectState::read8(ref<Expr> offset) const {
-  assert(!offset->isConstant() && "constant offset passed to symbolic read8");
+  assert(!isa<ConstantExpr>(offset) && "constant offset passed to symbolic read8");
   unsigned base, size;
   fastRangeCheckOffset(offset, &base, &size);
   flushRangeForRead(base, size);
@@ -328,8 +328,8 @@ void ObjectState::write8(unsigned offset, uint8_t value) {
 
 void ObjectState::write8(unsigned offset, ref<Expr> value) {
   // can happen when ExtractExpr special cases
-  if (value->isConstant()) {
-    write8(offset, (uint8_t) value->getConstantValue());
+  if (ConstantExpr *CE = dyn_cast<ConstantExpr>(value)) {
+    write8(offset, (uint8_t) CE->getConstantValue());
   } else {
     setKnownSymbolic(offset, value.get());
       
@@ -358,8 +358,8 @@ void ObjectState::write8(ref<Expr> offset, ref<Expr> value) {
 /***/
 
 ref<Expr> ObjectState::read(ref<Expr> offset, Expr::Width width) const {
-  if (offset->isConstant()) {
-    return read((unsigned) offset->getConstantValue(), width);
+  if (ConstantExpr *CE = dyn_cast<ConstantExpr>(offset)) {
+    return read((unsigned) CE->getConstantValue(), width);
   } else { 
     switch (width) {
     case  Expr::Bool: return  read1(offset);
@@ -547,8 +547,8 @@ ref<Expr> ObjectState::read64(ref<Expr> offset) const {
 
 void ObjectState::write(ref<Expr> offset, ref<Expr> value) {
   Expr::Width w = value->getWidth();
-  if (offset->isConstant()) {
-    write(offset->getConstantValue(), value);
+  if (ConstantExpr *CE = dyn_cast<ConstantExpr>(offset)) {
+    write(CE->getConstantValue(), value);
   } else {
     switch(w) {
     case  Expr::Bool:  write1(offset, value); break;
@@ -563,8 +563,8 @@ void ObjectState::write(ref<Expr> offset, ref<Expr> value) {
 
 void ObjectState::write(unsigned offset, ref<Expr> value) {
   Expr::Width w = value->getWidth();
-  if (value->isConstant()) {
-    uint64_t val = value->getConstantValue();
+  if (ConstantExpr *CE = dyn_cast<ConstantExpr>(value)) {
+    uint64_t val = CE->getConstantValue();
     switch(w) {
     case  Expr::Bool:
     case  Expr::Int8:  write8(offset, val); break;