From fa78e0da73f6aa581461baf8d3531b5c7f00abc9 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 27 Nov 2012 10:54:05 +0100 Subject: Silence compiler warning about unused variable --- include/klee/Internal/ADT/MapOfSets.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/klee/Internal/ADT/MapOfSets.h b/include/klee/Internal/ADT/MapOfSets.h index 25c5e2b9..c7568577 100644 --- a/include/klee/Internal/ADT/MapOfSets.h +++ b/include/klee/Internal/ADT/MapOfSets.h @@ -345,7 +345,6 @@ namespace klee { if (res) return res; } } else { - typename Node::children_ty::iterator kbegin = n->children.begin(); typename Node::children_ty::iterator kmid = n->children.lower_bound(*begin); for (typename Node::children_ty::iterator it = n->children.begin(), -- cgit 1.4.1 From e0dc5a1321ce657d15c564b029f1252d29eecb2c Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 27 Nov 2012 11:01:57 +0100 Subject: Disable redefinition of functions --- runtime/POSIX/fd_32.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/runtime/POSIX/fd_32.c b/runtime/POSIX/fd_32.c index 338d9ba2..6246f057 100644 --- a/runtime/POSIX/fd_32.c +++ b/runtime/POSIX/fd_32.c @@ -160,8 +160,7 @@ int __getdents(unsigned int fd, struct dirent *dirp, unsigned int count) /* Forward to 64 versions (uclibc expects versions w/o asm specifier) */ -int open64(const char *pathname, int flags, ...) __attribute__((weak)); -int open64(const char *pathname, int flags, ...) { +__attribute__((weak)) int open64(const char *pathname, int flags, ...) { mode_t mode = 0; if (flags & O_CREAT) { @@ -175,22 +174,18 @@ int open64(const char *pathname, int flags, ...) { return __fd_open(pathname, flags, mode); } -off64_t lseek64(int fd, off64_t off, int whence) __attribute__((weak)); -off64_t lseek64(int fd, off64_t off, int whence) { +__attribute__((weak)) off64_t lseek64(int fd, off64_t off, int whence) { return __fd_lseek(fd, off, whence); } -int stat64(const char *path, struct stat64 *buf) __attribute__((weak)); -int stat64(const char *path, struct stat64 *buf) { +__attribute__((weak)) int stat64(const char *path, struct stat64 *buf) { return __fd_stat(path, buf); } -int lstat64(const char *path, struct stat64 *buf) __attribute__((weak)); -int lstat64(const char *path, struct stat64 *buf) { +__attribute__((weak)) int lstat64(const char *path, struct stat64 *buf) { return __fd_lstat(path, buf); } -int fstat64(int fd, struct stat64 *buf) __attribute__((weak)); -int fstat64(int fd, struct stat64 *buf) { +__attribute__((weak)) int fstat64(int fd, struct stat64 *buf) { return __fd_fstat(fd, buf); } -- cgit 1.4.1 From 4ffd4b14b768a01006d515c6cad5c9b36ffdc4be Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 27 Nov 2012 11:01:15 +0100 Subject: Fix test case to use llvm-link instead of llvm-ld --- test/regression/2007-08-16-invalid-constant-value.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/regression/2007-08-16-invalid-constant-value.c b/test/regression/2007-08-16-invalid-constant-value.c index 75f87fe4..ea0a5fee 100644 --- a/test/regression/2007-08-16-invalid-constant-value.c +++ b/test/regression/2007-08-16-invalid-constant-value.c @@ -1,7 +1,7 @@ // RUN: rm -f %t4.out %t4.err %t4.log // RUN: %llvmgcc %s -emit-llvm -O2 -c -o %t1.bc // RUN: llvm-as -f %p/../Feature/_utils._ll -o %t2.bc -// RUN: llvm-ld -disable-opt %t1.bc %t2.bc -o %t3 +// RUN: llvm-link %t1.bc %t2.bc -o %t3.bc // RUN: %klee %t3.bc #include -- cgit 1.4.1 From 6c68f4ba60b860e83b8ee08b97f18f6a6cc29156 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 15 Jan 2013 12:00:08 +0100 Subject: Silence warning of deprecated PathV1 usage --- lib/Core/StatsTracker.cpp | 11 +++++++++++ tools/klee/main.cpp | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp index f81d19d8..c0028a05 100644 --- a/lib/Core/StatsTracker.cpp +++ b/lib/Core/StatsTracker.cpp @@ -45,6 +45,9 @@ #include "llvm/System/Path.h" #else #include "llvm/Support/Path.h" +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 1) +#include "llvm/Support/FileSystem.h" +#endif #endif #include @@ -177,10 +180,18 @@ StatsTracker::StatsTracker(Executor &_executor, std::string _objectFilename, KModule *km = executor.kmodule; sys::Path module(objectFilename); +#if LLVM_VERSION_CODE < LLVM_VERSION(3, 1) if (!sys::Path(objectFilename).isAbsolute()) { +#else + if (!sys::path::is_absolute(objectFilename)) { +#endif sys::Path current = sys::Path::GetCurrentDirectory(); current.appendComponent(objectFilename); +#if LLVM_VERSION_CODE < LLVM_VERSION(3, 1) if (current.exists()) +#else + if (sys::fs::exists(current.c_str())) +#endif objectFilename = current.c_str(); } diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index 79f29d2d..e4de4769 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -303,7 +303,11 @@ KleeHandler::KleeHandler(int argc, char **argv) } sys::Path p(theDir); +#if LLVM_VERSION_CODE < LLVM_VERSION(3, 1) if (!p.isAbsolute()) { +#else + if (!sys::path::is_absolute(p.c_str())) { +#endif sys::Path cwd = sys::Path::GetCurrentDirectory(); cwd.appendComponent(theDir); p = cwd; -- cgit 1.4.1 From 45fa391391b57beecefd2cbcf3ce243d8aaea4f7 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 27 Aug 2013 22:00:23 +0200 Subject: Link against shared library from LLVM correctly Searching for the LLVM library was conducted in the Klee project. This patch searches in the LLVM build directory. --- Makefile.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.rules b/Makefile.rules index f01649a9..ef72c06c 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -941,7 +941,7 @@ LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \ -L $(SharedLibDir) endif LLVMLibsOptions += -lLLVM-$(LLVMVersion) -LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT) +LLVMLibsPaths += $(LLVMSharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT) else ifndef NO_LLVM_CONFIG -- cgit 1.4.1 From 1f0255ab650b59ef8acafb57b23900f7d89046f7 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 27 Aug 2013 22:03:50 +0200 Subject: Fix constness warnings issued by gcc 4.7 --- include/klee/Expr.h | 2 +- lib/Core/Executor.cpp | 6 +++--- lib/Expr/Expr.cpp | 2 +- lib/Expr/Lexer.cpp | 2 +- lib/Solver/STPBuilder.cpp | 2 +- tools/klee/main.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/klee/Expr.h b/include/klee/Expr.h index 9d170dc5..4bebd521 100644 --- a/include/klee/Expr.h +++ b/include/klee/Expr.h @@ -364,7 +364,7 @@ public: virtual ref rebuild(ref kids[]) const { assert(0 && "rebuild() on ConstantExpr"); - return (Expr*) this; + return const_cast(this); } virtual unsigned computeHash(); diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 184b0983..ba9db804 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -425,17 +425,17 @@ void Executor::initializeGlobals(ExecutionState &state) { char' value [0,255]; by EOF (-1); or by any `signed char' value [-128,-1). ISO C requires that the ctype functions work for `unsigned */ const uint16_t **addr = __ctype_b_loc(); - addExternalObject(state, (void *)(*addr-128), + addExternalObject(state, const_cast(*addr-128), 384 * sizeof **addr, true); addExternalObject(state, addr, sizeof(*addr), true); const int32_t **lower_addr = __ctype_tolower_loc(); - addExternalObject(state, (void *)(*lower_addr-128), + addExternalObject(state, const_cast(*lower_addr-128), 384 * sizeof **lower_addr, true); addExternalObject(state, lower_addr, sizeof(*lower_addr), true); const int32_t **upper_addr = __ctype_toupper_loc(); - addExternalObject(state, (void *)(*upper_addr-128), + addExternalObject(state, const_cast(*upper_addr-128), 384 * sizeof **upper_addr, true); addExternalObject(state, upper_addr, sizeof(*upper_addr), true); #endif diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index 1187573b..a28ad907 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -342,7 +342,7 @@ void ConstantExpr::toMemory(void *address) { case Expr::Int64: *((uint64_t*) address) = getZExtValue(64); break; // FIXME: what about machines without x87 support? case Expr::Fl80: - *((long double*) address) = *(long double*) value.getRawData(); + *((long double*) address) = *(const long double*) value.getRawData(); break; } } diff --git a/lib/Expr/Lexer.cpp b/lib/Expr/Lexer.cpp index 95d6072b..9859ff36 100644 --- a/lib/Expr/Lexer.cpp +++ b/lib/Expr/Lexer.cpp @@ -54,7 +54,7 @@ const char *Token::getKindName() const { void Token::dump() { llvm::errs() << "(Token \"" << getKindName() << "\" " - << (void*) start << " " << length << " " + << (const void*) start << " " << length << " " << line << " " << column << ")"; } diff --git a/lib/Solver/STPBuilder.cpp b/lib/Solver/STPBuilder.cpp index 789eb244..90252656 100644 --- a/lib/Solver/STPBuilder.cpp +++ b/lib/Solver/STPBuilder.cpp @@ -435,7 +435,7 @@ ExprHandle STPBuilder::constructSDivByConstant(ExprHandle expr_n, unsigned width // STP uniques arrays by name, so we make sure the name is unique by // including the address. char buf[32]; - unsigned const addrlen = sprintf(buf, "_%p", (void*)root) + 1; // +1 for null-termination + unsigned const addrlen = sprintf(buf, "_%p", (const void*)root) + 1; // +1 for null-termination unsigned const space = (root->name.length() > 32 - addrlen)?(32 - addrlen):root->name.length(); memmove(buf + space, buf, addrlen); // moving the address part to the end memcpy(buf, root->name.c_str(), space); // filling out the name part diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index e4de4769..0d899ae9 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -604,7 +604,7 @@ static void parseArguments(int argc, char **argv) { argArray[i] = arguments[i-1].c_str(); } - cl::ParseCommandLineOptions(numArgs, (char**) argArray, " klee\n"); + cl::ParseCommandLineOptions(numArgs, (const char**) argArray, " klee\n"); delete[] argArray; } -- cgit 1.4.1 From 6c445f2b1a1f91ffb301bece325dd5a491922ce1 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 27 Aug 2013 22:06:51 +0200 Subject: Fixed warning about unused variable --- lib/Module/KModule.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index ea86433e..1629bb79 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -390,7 +390,6 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, if (NoTruncateSourceLines) { *ros << *module; } else { - bool truncated = false; std::string string; llvm::raw_string_ostream rss(string); rss << *module; @@ -409,7 +408,6 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, } else { ros->write(position, 254); *ros << "\n"; - truncated = true; } position = end+1; } -- cgit 1.4.1