diff options
Diffstat (limited to 'lib/Core')
-rw-r--r-- | lib/Core/Executor.cpp | 6 | ||||
-rw-r--r-- | lib/Core/StatsTracker.cpp | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 88ede5c8..069022a2 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<uint16_t*>(*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<int32_t*>(*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<int32_t*>(*upper_addr-128), 384 * sizeof **upper_addr, true); addExternalObject(state, upper_addr, sizeof(*upper_addr), true); #endif 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 <iostream> @@ -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(); } |