From 930ae7d06fc1d8cc3117397cb3fd168a0a1090b7 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Sat, 23 Apr 2011 19:22:22 +0000 Subject: Patch by arrowdodger (http://keeda.stanford.edu/pipermail/klee-dev/2011-April/000617.html) for compiling KLEE with the latest LLVM changes. Tested against LLVM 2.7 and 2.8. The AsmAddresses test fails in 2.8 unless assertions are explicitely enabled (--enable-assertions). git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@130065 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Expr/Expr.cpp | 4 ++++ lib/Expr/Parser.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) (limited to 'lib/Expr') diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index 71e64325..e02a7e49 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -336,7 +336,11 @@ void ConstantExpr::toString(std::string &Res) const { ref ConstantExpr::Concat(const ref &RHS) { Expr::Width W = getWidth() + RHS->getWidth(); APInt Tmp(value); +#if (LLVM_VERSION_MAJOR < 3) Tmp.zext(W); +#else + Tmp=Tmp.zext(W); +#endif Tmp <<= RHS->getWidth(); Tmp |= APInt(RHS->value).zext(W); diff --git a/lib/Expr/Parser.cpp b/lib/Expr/Parser.cpp index caeeabd7..a41c5624 100644 --- a/lib/Expr/Parser.cpp +++ b/lib/Expr/Parser.cpp @@ -1496,9 +1496,17 @@ ExprResult ParserImpl::ParseNumberToken(Expr::Width Type, const Token &Tok) { Val = -Val; if (Type < Val.getBitWidth()) +#if (LLVM_VERSION_MAJOR < 3) Val.trunc(Type); +#else + Val=Val.trunc(Type); +#endif else if (Type > Val.getBitWidth()) +#if (LLVM_VERSION_MAJOR < 3) Val.zext(Type); +#else + Val=Val.zext(Type); +#endif return ExprResult(Builder->Constant(Val)); } -- cgit 1.4.1