From c0ca66d33b7f968710b7fcaecb2dee9a12648344 Mon Sep 17 00:00:00 2001 From: Lukas Sommer Date: Sun, 12 Jun 2016 14:34:42 +0200 Subject: [PATCH 1/3] Minor bug-fix for LLVM version 3.8; --- src/RangeAnalysis/RangeAnalysis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RangeAnalysis/RangeAnalysis.cpp b/src/RangeAnalysis/RangeAnalysis.cpp index 7ea6478..b84ffce 100644 --- a/src/RangeAnalysis/RangeAnalysis.cpp +++ b/src/RangeAnalysis/RangeAnalysis.cpp @@ -325,7 +325,7 @@ void InterProceduralRA::MatchParametersAndReturnValues( for (i = 0, argptr = F.arg_begin(), e = F.arg_end(); argptr != e; ++i, ++argptr) - Parameters[i].first = argptr; + Parameters[i].first = &*argptr; // Check if the function returns a supported value type. If not, no return // value matching is done From 384e33b3361fa06f77f310dabf32096d47c10491 Mon Sep 17 00:00:00 2001 From: Lukas Sommer Date: Sun, 12 Jun 2016 14:45:22 +0200 Subject: [PATCH 2/3] Minor bug-fix on vSSA-pass for LLVM 3.8; --- src/vSSA/vSSA.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vSSA/vSSA.cpp b/src/vSSA/vSSA.cpp index 256689f..349e2c3 100755 --- a/src/vSSA/vSSA.cpp +++ b/src/vSSA/vSSA.cpp @@ -40,7 +40,7 @@ bool vSSA::runOnFunction(Function &F) { // Iterate over all Basic Blocks of the Function, calling the function that creates sigma functions, if needed for (Function::iterator Fit = F.begin(), Fend = F.end(); Fit != Fend; ++Fit) { - createSigmasIfNeeded(Fit); + createSigmasIfNeeded(&*Fit); } return true; } From 9cc159197425e50568d08bc87e90e96a27e08a83 Mon Sep 17 00:00:00 2001 From: Lukas Sommer Date: Sun, 12 Jun 2016 18:35:08 +0200 Subject: [PATCH 3/3] Support LLVM out-of-source CMake-based build; --- .gitignore | 2 ++ src/CMakeConfig.mk.example | 3 +++ src/CMakeLists.txt | 20 ++++++++++++++++++++ src/RangeAnalysis/CMakeLists.txt | 6 +----- src/vSSA/CMakeLists.txt | 8 ++++++++ 5 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 .gitignore create mode 100644 src/CMakeConfig.mk.example create mode 100644 src/CMakeLists.txt create mode 100644 src/vSSA/CMakeLists.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3319633 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.mk +build diff --git a/src/CMakeConfig.mk.example b/src/CMakeConfig.mk.example new file mode 100644 index 0000000..f63c68e --- /dev/null +++ b/src/CMakeConfig.mk.example @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) + +set(LLVM_DIR "/home/user/code/llvm_38/llvm-bin/share/llvm/cmake/") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..68c2452 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.0) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + +include(CMakeConfig.mk) +find_package(LLVM REQUIRED CONFIG) + +list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") +include(AddLLVM) + +message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") +message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") + +add_definitions(${LLVM_DEFINITIONS}) +include_directories(${LLVM_INCLUDE_DIRS}) + +message(STATUS "Include dirs: ${LLVM_INCLUDE_DIRS}") + +add_subdirectory(RangeAnalysis) +add_subdirectory(vSSA) \ No newline at end of file diff --git a/src/RangeAnalysis/CMakeLists.txt b/src/RangeAnalysis/CMakeLists.txt index f3c2cc7..a2860e3 100644 --- a/src/RangeAnalysis/CMakeLists.txt +++ b/src/RangeAnalysis/CMakeLists.txt @@ -5,8 +5,4 @@ if(WIN32 OR CYGWIN) endif() add_llvm_loadable_module( RangeAnalysis - RangeAnalysis.cpp - - DEPENDS - intrinsics_gen - ) + RangeAnalysis.cpp) diff --git a/src/vSSA/CMakeLists.txt b/src/vSSA/CMakeLists.txt new file mode 100644 index 0000000..2646f14 --- /dev/null +++ b/src/vSSA/CMakeLists.txt @@ -0,0 +1,8 @@ +# If we don't need RTTI or EH, there's no reason to export anything +# from the hello plugin. +if(WIN32 OR CYGWIN) + set(LLVM_LINK_COMPONENTS Core Support) +endif() + +add_llvm_loadable_module( vSSA + vSSA.cpp) \ No newline at end of file