diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp index 66a4fbbb0e..4f6a291047 100644 --- a/lib/Core/ExternalDispatcher.cpp +++ b/lib/Core/ExternalDispatcher.cpp @@ -306,17 +306,13 @@ Function *ExternalDispatcherImpl::createDispatcher(KCallable *target, llvm::IRBuilder<> Builder(dBB); // Get a Value* for &gTheArgsP, as an i64**. -#if LLVM_VERSION_CODE >= LLVM_VERSION(15, 0) auto argI64sp = Builder.CreateIntToPtr( ConstantInt::get(Type::getInt64Ty(ctx), (uintptr_t)&gTheArgsP), PointerType::getUnqual(PointerType::getUnqual(Type::getInt64Ty(ctx))), "argsp"); +#if LLVM_VERSION_CODE >= LLVM_VERSION(15, 0) auto argI64s = Builder.CreateLoad(Builder.getPtrTy(), argI64sp, "args"); #else - auto argI64sp = Builder.CreateIntToPtr( - ConstantInt::get(Type::getInt64Ty(ctx), (uintptr_t)(void *)&gTheArgsP), - PointerType::getUnqual(PointerType::getUnqual(Type::getInt64Ty(ctx))), - "argsp"); auto argI64s = Builder.CreateLoad( argI64sp->getType()->getPointerElementType(), argI64sp, "args"); #endif diff --git a/lib/Core/SpecialFunctionHandler.cpp b/lib/Core/SpecialFunctionHandler.cpp index 62557719a2..bd8fa2c255 100644 --- a/lib/Core/SpecialFunctionHandler.cpp +++ b/lib/Core/SpecialFunctionHandler.cpp @@ -206,7 +206,7 @@ SpecialFunctionHandler::SpecialFunctionHandler(Executor &_executor) void SpecialFunctionHandler::prepare( std::vector &preservedFunctions) { - for (auto &hi : handlerInfo) { + for (const auto &hi : handlerInfo) { Function *f = executor.kmodule->module->getFunction(hi.name); // No need to create if the function doesn't exist, since it cannot @@ -227,7 +227,7 @@ void SpecialFunctionHandler::prepare( } void SpecialFunctionHandler::bind() { - for (auto &hi : handlerInfo) { + for (const auto &hi : handlerInfo) { Function *f = executor.kmodule->module->getFunction(hi.name); if (f && (!hi.doNotOverride || f->isDeclaration())) { diff --git a/lib/Solver/STPSolver.cpp b/lib/Solver/STPSolver.cpp index 053b34824a..98b80ac20d 100644 --- a/lib/Solver/STPSolver.cpp +++ b/lib/Solver/STPSolver.cpp @@ -214,7 +214,7 @@ std::string STPSolverImpl::getConstraintLog(const Query &query) { vc_printQueryStateToBuffer(vc, builder->getFalse(), &buffer, &length, false); vc_pop(vc); - std::string result = buffer; + std::string result(buffer); std::free(buffer); return result; diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 3e7b3bc2e1..42600a57df 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -42,7 +42,7 @@ foreach (bc_architecture ${bc_architectures}) elseif (bc_optimization STREQUAL "Release+Debug+Asserts") list(APPEND local_flags -O2 -g -D_DEBUG) elseif (bc_optimization STREQUAL "Debug") - list(APPEND local_flags -g -D_DEBUG -DNDEBUG) + list(APPEND local_flags -g -D_DEBUG --fpermissive) elseif (bc_optimization STREQUAL "Debug+Asserts") list(APPEND local_flags -g -D_DEBUG) else() diff --git a/tools/kleaver/CMakeLists.txt b/tools/kleaver/CMakeLists.txt index 4b4cf8de59..dda7b1be65 100644 --- a/tools/kleaver/CMakeLists.txt +++ b/tools/kleaver/CMakeLists.txt @@ -13,12 +13,10 @@ add_executable(kleaver llvm_config(kleaver "${USE_LLVM_SHARED}" core support) target_link_libraries(kleaver PRIVATE kleaverSolver) -target_include_directories(klee SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS}) -target_include_directories(klee PRIVATE ${KLEE_INCLUDE_DIRS}) +target_include_directories(kleaver SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS}) +target_include_directories(kleaver PRIVATE ${KLEE_INCLUDE_DIRS}) target_compile_options(kleaver PRIVATE ${KLEE_COMPONENT_CXX_FLAGS}) target_compile_definitions(kleaver PRIVATE ${KLEE_COMPONENT_CXX_DEFINES}) -target_compile_definitions(kleaver PRIVATE ${KLEE_COMPONENT_CXX_DEFINES}) - install(TARGETS kleaver RUNTIME DESTINATION bin) diff --git a/unittests/Searcher/CMakeLists.txt b/unittests/Searcher/CMakeLists.txt index 7132f1d617..5f5347cc45 100644 --- a/unittests/Searcher/CMakeLists.txt +++ b/unittests/Searcher/CMakeLists.txt @@ -5,4 +5,5 @@ target_include_directories(SearcherTest BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/lib" target_compile_options(SearcherTest PRIVATE ${KLEE_COMPONENT_CXX_FLAGS}) target_compile_definitions(SearcherTest PRIVATE ${KLEE_COMPONENT_CXX_DEFINES}) -target_include_directories(SearcherTest PRIVATE ${KLEE_INCLUDE_DIRS} ${SQLite3_INCLUDE_DIRS}) +target_include_directories(SearcherTest SYSTEM PRIVATE ${SQLite3_INCLUDE_DIRS}) +target_include_directories(SearcherTest PRIVATE ${KLEE_INCLUDE_DIRS})