about summary refs log tree commit diff homepage
path: root/lib/Expr
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2012-04-07 00:40:20 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2012-04-07 00:40:20 +0000
commit8c0baabe77c64b87cb11ec9f5b64aaf4571990fd (patch)
treea452dab638932174c1268aae7676189dbc2e7ac7 /lib/Expr
parentc97def2e6bc8428923c83301ab9e34d13b33d3fc (diff)
downloadklee-8c0baabe77c64b87cb11ec9f5b64aaf4571990fd.tar.gz
Catch up with hashing changes.
Patch by arrowdodger!

git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@154237 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Expr')
-rw-r--r--lib/Expr/Expr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index 420eaa90..089e78b3 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -10,6 +10,9 @@
 #include "klee/Expr.h"
 #include "klee/Config/Version.h"
 
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 1)
+#include "llvm/ADT/Hashing.h"
+#endif
 #include "llvm/Support/CommandLine.h"
 // FIXME: We shouldn't need this once fast constant support moves into
 // Core. If we need to do arithmetic, we probably want to use APInt.
@@ -174,7 +177,11 @@ unsigned Expr::computeHash() {
 }
 
 unsigned ConstantExpr::computeHash() {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 1)
+  hashValue = hash_value(value) ^ (getWidth() * MAGIC_HASH_CONSTANT);
+#else
   hashValue = value.getHashValue() ^ (getWidth() * MAGIC_HASH_CONSTANT);
+#endif
   return hashValue;
 }