From 8c0baabe77c64b87cb11ec9f5b64aaf4571990fd Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Sat, 7 Apr 2012 00:40:20 +0000 Subject: 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 --- lib/Expr/Expr.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') 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; } -- cgit 1.4.1