Some tools may want to use the LLVM "diff" code. Move the code into a
library for easy use.
No functionality change intende.
Differential Revision: https://reviews.llvm.org/D107392
add_llvm_tool(llvm-diff
llvm-diff.cpp
- DiffConsumer.cpp
- DiffLog.cpp
- DifferenceEngine.cpp
DEPENDS
intrinsics_gen
)
+
+add_subdirectory(lib)
+target_link_libraries(llvm-diff PRIVATE LLVMDiff)
--- /dev/null
+set(LLVM_LINK_COMPONENTS
+ Core
+ Support
+ )
+
+add_llvm_library(LLVMDiff
+ STATIC
+ DiffConsumer.cpp
+ DiffConsumer.h
+ DifferenceEngine.cpp
+ DifferenceEngine.h
+ DiffLog.cpp
+ DiffLog.h
+ )
//
//===----------------------------------------------------------------------===//
-#include "DiffLog.h"
-#include "DifferenceEngine.h"
+#include "lib/DiffLog.h"
+#include "lib/DifferenceEngine.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"