From c27f225e79b82d3de4f70578cb80d0603fbff6f1 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Wed, 22 Feb 2017 15:57:55 +0100 Subject: llvm: make KLEE compile against LLVM 3.9 Signed-off-by: Jiri Slaby --- lib/Core/Executor.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/Core/Executor.cpp') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index b053d488..7f69a618 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -1338,10 +1338,18 @@ void Executor::executeCall(ExecutionState &state, // // Alignment requirements for scalar types is the same as their size if (argWidth > Expr::Int64) { +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) + size = llvm::alignTo(size, 16); +#else size = llvm::RoundUpToAlignment(size, 16); +#endif requires16ByteAlignment = true; } +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) + size += llvm::alignTo(argWidth, WordSize) / 8; +#else size += llvm::RoundUpToAlignment(argWidth, WordSize) / 8; +#endif } } @@ -1374,10 +1382,18 @@ void Executor::executeCall(ExecutionState &state, Expr::Width argWidth = arguments[i]->getWidth(); if (argWidth > Expr::Int64) { +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) + offset = llvm::alignTo(offset, 16); +#else offset = llvm::RoundUpToAlignment(offset, 16); +#endif } os->write(offset, arguments[i]); +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) + offset += llvm::alignTo(argWidth, WordSize) / 8; +#else offset += llvm::RoundUpToAlignment(argWidth, WordSize) / 8; +#endif } } } -- cgit 1.4.1