aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/Core/Memory.h6
-rw-r--r--lib/Core/SpecialFunctionHandler.cpp4
-rw-r--r--lib/Expr/Constraints.cpp2
-rw-r--r--lib/Expr/Expr.cpp2
-rw-r--r--lib/Solver/STPBuilder.cpp4
5 files changed, 9 insertions, 9 deletions
diff --git a/lib/Core/Memory.h b/lib/Core/Memory.h
index 7f7b86a8..9ce8e09b 100644
--- a/lib/Core/Memory.h
+++ b/lib/Core/Memory.h
@@ -40,10 +40,10 @@ public:
/// size in bytes
unsigned size;
- std::string name;
+ mutable std::string name;
bool isLocal;
- bool isGlobal;
+ mutable bool isGlobal;
bool isFixed;
/// true if created by us.
@@ -96,7 +96,7 @@ public:
/// Get an identifying string for this allocation.
void getAllocInfo(std::string &result) const;
- void setName(std::string name) {
+ void setName(std::string name) const {
this->name = name;
}
diff --git a/lib/Core/SpecialFunctionHandler.cpp b/lib/Core/SpecialFunctionHandler.cpp
index ba86428d..1b96d5f1 100644
--- a/lib/Core/SpecialFunctionHandler.cpp
+++ b/lib/Core/SpecialFunctionHandler.cpp
@@ -644,7 +644,7 @@ void SpecialFunctionHandler::handleMakeSymbolic(ExecutionState &state,
for (Executor::ExactResolutionList::iterator it = rl.begin(),
ie = rl.end(); it != ie; ++it) {
- MemoryObject *mo = (MemoryObject*) it->first.first;
+ const MemoryObject *mo = it->first.first;
mo->setName(name);
const ObjectState *old = it->first.second;
@@ -688,7 +688,7 @@ void SpecialFunctionHandler::handleMarkGlobal(ExecutionState &state,
for (Executor::ExactResolutionList::iterator it = rl.begin(),
ie = rl.end(); it != ie; ++it) {
- MemoryObject *mo = (MemoryObject*) it->first.first;
+ const MemoryObject *mo = it->first.first;
assert(!mo->isLocal);
mo->isGlobal = true;
}
diff --git a/lib/Expr/Constraints.cpp b/lib/Expr/Constraints.cpp
index 9c09e643..b759daae 100644
--- a/lib/Expr/Constraints.cpp
+++ b/lib/Expr/Constraints.cpp
@@ -52,7 +52,7 @@ public:
Action visitExprPost(const Expr &e) {
std::map< ref<Expr>, ref<Expr> >::const_iterator it =
- replacements.find(ref<Expr>((Expr*) &e));
+ replacements.find(ref<Expr>(const_cast<Expr*>(&e)));
if (it!=replacements.end()) {
return Action::changeTo(it->second);
} else {
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index 703c689f..71e64325 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -288,7 +288,7 @@ ref<Expr> Expr::createIsZero(ref<Expr> e) {
}
void Expr::print(std::ostream &os) const {
- ExprPPrinter::printSingleExpr(os, (Expr*)this);
+ ExprPPrinter::printSingleExpr(os, const_cast<Expr*>(this));
}
void Expr::dump() const {
diff --git a/lib/Solver/STPBuilder.cpp b/lib/Solver/STPBuilder.cpp
index 4e091600..de53816c 100644
--- a/lib/Solver/STPBuilder.cpp
+++ b/lib/Solver/STPBuilder.cpp
@@ -73,7 +73,7 @@ STPBuilder::~STPBuilder() {
::VCExpr STPBuilder::buildVar(const char *name, unsigned width) {
// XXX don't rebuild if this stuff cons's
::Type t = (width==1) ? vc_boolType(vc) : vc_bvType(vc, width);
- ::VCExpr res = vc_varExpr(vc, (char*) name, t);
+ ::VCExpr res = vc_varExpr(vc, const_cast<char*>(name), t);
vc_DeleteExpr(t);
return res;
}
@@ -83,7 +83,7 @@ STPBuilder::~STPBuilder() {
::Type t1 = vc_bvType(vc, indexWidth);
::Type t2 = vc_bvType(vc, valueWidth);
::Type t = vc_arrayType(vc, t1, t2);
- ::VCExpr res = vc_varExpr(vc, (char*) name, t);
+ ::VCExpr res = vc_varExpr(vc, const_cast<char*>(name), t);
vc_DeleteExpr(t);
vc_DeleteExpr(t2);
vc_DeleteExpr(t1);