Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes for LLVM 3.8 and CMake out-of-source build #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.mk
build
3 changes: 3 additions & 0 deletions src/CMakeConfig.mk.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.0)

set(LLVM_DIR "/home/user/code/llvm_38/llvm-bin/share/llvm/cmake/")
20 changes: 20 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 1 addition & 5 deletions src/RangeAnalysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ if(WIN32 OR CYGWIN)
endif()

add_llvm_loadable_module( RangeAnalysis
RangeAnalysis.cpp

DEPENDS
intrinsics_gen
)
RangeAnalysis.cpp)
2 changes: 1 addition & 1 deletion src/RangeAnalysis/RangeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void InterProceduralRA<CGT>::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
Expand Down
8 changes: 8 additions & 0 deletions src/vSSA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion src/vSSA/vSSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down