From 848163c3886a1f5afb01fbbb154711c2dcf6ff65 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 30 Nov 2018 17:50:05 -0500 Subject: [PATCH] Upload base structure --- .gitignore | 3 +++ CMakeLists.txt | 19 +++++++++++++++++++ CPI.cpp | 13 +++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 CPI.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f4774b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/build +/cmake-build-debug +/.idea diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..150b736 --- /dev/null +++ b/CMakeLists.txt @@ -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 +) diff --git a/CPI.cpp b/CPI.cpp new file mode 100644 index 0000000..c870205 --- /dev/null +++ b/CPI.cpp @@ -0,0 +1,13 @@ +#include + +using namespace llvm; + +struct CPI : public ModulePass { + static char ID; + CPI() : ModulePass(ID) {} + + bool runOnModule(Module &M) override { + return false; + } +}; +