Upload base structure

This commit is contained in:
topjohnwu 2018-11-30 17:50:05 -05:00
parent 2b5370c292
commit 848163c388
3 changed files with 35 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/build
/cmake-build-debug
/.idea

19
CMakeLists.txt Normal file
View File

@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.4.3)
project(CPI)
find_package(LLVM REQUIRED CONFIG)
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
set(CMAKE_CXX_STANDARD 14)
add_definitions(${LLVM_DEFINITIONS})
include_directories(${LLVM_INCLUDE_DIRS})
if (APPLE)
list (APPEND CMAKE_CXX_FLAGS "-undefined dynamic_lookup")
endif(APPLE)
add_llvm_loadable_module(
LLVMCPI
CPI.cpp
)

13
CPI.cpp Normal file
View File

@ -0,0 +1,13 @@
#include <llvm/Pass.h>
using namespace llvm;
struct CPI : public ModulePass {
static char ID;
CPI() : ModulePass(ID) {}
bool runOnModule(Module &M) override {
return false;
}
};