diff --git a/include/llvm/Support/FileCheck.h b/include/llvm/FileCheck/FileCheck.h similarity index 97% rename from include/llvm/Support/FileCheck.h rename to include/llvm/FileCheck/FileCheck.h index 1eb609ef725..f9fd3d72f88 100644 --- a/include/llvm/Support/FileCheck.h +++ b/include/llvm/FileCheck/FileCheck.h @@ -1,4 +1,4 @@ -//==-- llvm/Support/FileCheck.h ---------------------------*- C++ -*-==// +//==-- llvm/FileCheck/FileCheck.h --------------------------------*- C++ -*-==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -10,8 +10,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_FILECHECK_H -#define LLVM_SUPPORT_FILECHECK_H +#ifndef LLVM_FILECHECK_FILECHECK_H +#define LLVM_FILECHECK_FILECHECK_H #include "llvm/ADT/StringRef.h" #include "llvm/Support/MemoryBuffer.h" diff --git a/include/llvm/module.modulemap b/include/llvm/module.modulemap index 0ce3574e9b0..22959c62fc8 100644 --- a/include/llvm/module.modulemap +++ b/include/llvm/module.modulemap @@ -195,6 +195,13 @@ module LLVM_ExecutionEngine { } +module LLVM_FileCheck { + requires cplusplus + + umbrella "FileCheck" + module * { export * } +} + // Orc utilities that don't depend only on Support (not ExecutionEngine or // IR). This is a workaround for ExecutionEngine's broken layering, and will // be removed in the future. diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 35d204d7d63..851b89bb95f 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -3,6 +3,7 @@ add_subdirectory(IR) add_subdirectory(FuzzMutate) +add_subdirectory(FileCheck) add_subdirectory(InterfaceStub) add_subdirectory(IRReader) add_subdirectory(CodeGen) diff --git a/lib/FileCheck/CMakeLists.txt b/lib/FileCheck/CMakeLists.txt new file mode 100644 index 00000000000..91c80e1482f --- /dev/null +++ b/lib/FileCheck/CMakeLists.txt @@ -0,0 +1,8 @@ +add_llvm_component_library(LLVMFileCheck + FileCheck.cpp + + ADDITIONAL_HEADER_DIRS + "${LLVM_MAIN_INCLUDE_DIR}/llvm/FileCheck" +) + +target_link_libraries(LLVMFileCheck LLVMSupport) diff --git a/lib/Support/FileCheck.cpp b/lib/FileCheck/FileCheck.cpp similarity index 99% rename from lib/Support/FileCheck.cpp rename to lib/FileCheck/FileCheck.cpp index 0cc3a2d7392..a0371cf88b3 100644 --- a/lib/Support/FileCheck.cpp +++ b/lib/FileCheck/FileCheck.cpp @@ -13,7 +13,7 @@ // as well as various unittests. //===----------------------------------------------------------------------===// -#include "llvm/Support/FileCheck.h" +#include "llvm/FileCheck/FileCheck.h" #include "FileCheckImpl.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringSet.h" diff --git a/lib/Support/FileCheckImpl.h b/lib/FileCheck/FileCheckImpl.h similarity index 99% rename from lib/Support/FileCheckImpl.h rename to lib/FileCheck/FileCheckImpl.h index 7cdeb7c766f..05b2a529002 100644 --- a/lib/Support/FileCheckImpl.h +++ b/lib/FileCheck/FileCheckImpl.h @@ -12,13 +12,13 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIB_SUPPORT_FILECHECKIMPL_H -#define LLVM_LIB_SUPPORT_FILECHECKIMPL_H +#ifndef LLVM_LIB_FILECHECK_FILECHECKIMPL_H +#define LLVM_LIB_FILECHECK_FILECHECKIMPL_H -#include "llvm/Support/FileCheck.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" +#include "llvm/FileCheck/FileCheck.h" #include "llvm/Support/Error.h" #include "llvm/Support/SourceMgr.h" #include diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt index 5e0d43b148d..9eefea566fe 100644 --- a/lib/Support/CMakeLists.txt +++ b/lib/Support/CMakeLists.txt @@ -134,7 +134,6 @@ add_llvm_component_library(LLVMSupport Error.cpp ErrorHandling.cpp ExtensibleRTTI.cpp - FileCheck.cpp FileCollector.cpp FileUtilities.cpp FileOutputBuffer.cpp diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 850bc14b207..4076642a217 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -24,6 +24,7 @@ add_subdirectory(CodeGen) add_subdirectory(DebugInfo) add_subdirectory(Demangle) add_subdirectory(ExecutionEngine) +add_subdirectory(FileCheck) add_subdirectory(Frontend) add_subdirectory(FuzzMutate) add_subdirectory(InterfaceStub) diff --git a/unittests/CodeGen/GlobalISel/CMakeLists.txt b/unittests/CodeGen/GlobalISel/CMakeLists.txt index 7ca77b98dc0..4b278217f73 100644 --- a/unittests/CodeGen/GlobalISel/CMakeLists.txt +++ b/unittests/CodeGen/GlobalISel/CMakeLists.txt @@ -2,6 +2,7 @@ set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} CodeGen Core + FileCheck GlobalISel MC MIRParser diff --git a/unittests/CodeGen/GlobalISel/GISelMITest.h b/unittests/CodeGen/GlobalISel/GISelMITest.h index db3f2b9531c..336915ce865 100644 --- a/unittests/CodeGen/GlobalISel/GISelMITest.h +++ b/unittests/CodeGen/GlobalISel/GISelMITest.h @@ -21,8 +21,8 @@ #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/FileCheck/FileCheck.h" #include "llvm/InitializePasses.h" -#include "llvm/Support/FileCheck.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/TargetSelect.h" diff --git a/unittests/FileCheck/CMakeLists.txt b/unittests/FileCheck/CMakeLists.txt new file mode 100644 index 00000000000..7fe4f0c009d --- /dev/null +++ b/unittests/FileCheck/CMakeLists.txt @@ -0,0 +1,10 @@ +set(LLVM_LINK_COMPONENTS + FileCheck + Support +) + +add_llvm_unittest(FileCheckTests + FileCheckTest.cpp +) + +target_link_libraries(FileCheckTests PRIVATE LLVMTestingSupport) diff --git a/unittests/Support/FileCheckTest.cpp b/unittests/FileCheck/FileCheckTest.cpp similarity index 99% rename from unittests/Support/FileCheckTest.cpp rename to unittests/FileCheck/FileCheckTest.cpp index e986c434c55..c5eaa5fb04d 100644 --- a/unittests/Support/FileCheckTest.cpp +++ b/unittests/FileCheck/FileCheckTest.cpp @@ -1,4 +1,4 @@ -//===- llvm/unittest/Support/FileCheckTest.cpp - FileCheck tests --===// +//===- llvm/unittest/FileCheck/FileCheckTest.cpp - FileCheck tests --------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/FileCheck.h" -#include "../lib/Support/FileCheckImpl.h" +#include "llvm/FileCheck/FileCheck.h" +#include "../lib/FileCheck/FileCheckImpl.h" #include "llvm/Support/Regex.h" #include "llvm/Testing/Support/Error.h" #include "gtest/gtest.h" diff --git a/unittests/Support/CMakeLists.txt b/unittests/Support/CMakeLists.txt index 19fabfe2c74..30de294f499 100644 --- a/unittests/Support/CMakeLists.txt +++ b/unittests/Support/CMakeLists.txt @@ -33,7 +33,6 @@ add_llvm_unittest(SupportTests ErrorOrTest.cpp ErrorTest.cpp ExtensibleRTTITest.cpp - FileCheckTest.cpp FileCollectorTest.cpp FileOutputBufferTest.cpp FileUtilitiesTest.cpp diff --git a/utils/FileCheck/CMakeLists.txt b/utils/FileCheck/CMakeLists.txt index 32e948a1a19..d1703432317 100644 --- a/utils/FileCheck/CMakeLists.txt +++ b/utils/FileCheck/CMakeLists.txt @@ -2,4 +2,4 @@ add_llvm_utility(FileCheck FileCheck.cpp ) -target_link_libraries(FileCheck PRIVATE LLVMSupport) +target_link_libraries(FileCheck PRIVATE LLVMFileCheck LLVMSupport) diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp index 81889b2540f..66b0a9776aa 100644 --- a/utils/FileCheck/FileCheck.cpp +++ b/utils/FileCheck/FileCheck.cpp @@ -15,12 +15,12 @@ // //===----------------------------------------------------------------------===// +#include "llvm/FileCheck/FileCheck.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/Process.h" #include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Support/FileCheck.h" #include using namespace llvm; diff --git a/utils/gn/secondary/llvm/lib/FileCheck/BUILD.gn b/utils/gn/secondary/llvm/lib/FileCheck/BUILD.gn new file mode 100644 index 00000000000..af211df351a --- /dev/null +++ b/utils/gn/secondary/llvm/lib/FileCheck/BUILD.gn @@ -0,0 +1,7 @@ +static_library("FileCheck") { + output_name = "LLVMFileCheck" + deps = [ "//llvm/lib/Support" ] + sources = [ + "FileCheck.cpp", + ] +} diff --git a/utils/gn/secondary/llvm/lib/Support/BUILD.gn b/utils/gn/secondary/llvm/lib/Support/BUILD.gn index 93270c20243..150847aa9b0 100644 --- a/utils/gn/secondary/llvm/lib/Support/BUILD.gn +++ b/utils/gn/secondary/llvm/lib/Support/BUILD.gn @@ -71,7 +71,6 @@ static_library("Support") { "Error.cpp", "ErrorHandling.cpp", "ExtensibleRTTI.cpp", - "FileCheck.cpp", "FileCollector.cpp", "FileOutputBuffer.cpp", "FileUtilities.cpp", diff --git a/utils/gn/secondary/llvm/unittests/BUILD.gn b/utils/gn/secondary/llvm/unittests/BUILD.gn index 5a235671e5c..ae233fd7bde 100644 --- a/utils/gn/secondary/llvm/unittests/BUILD.gn +++ b/utils/gn/secondary/llvm/unittests/BUILD.gn @@ -20,6 +20,7 @@ group("unittests") { "ExecutionEngine/JITLink:JITLinkTests", "ExecutionEngine/MCJIT:MCJITTests", "ExecutionEngine/Orc:OrcJITTests", + "FileCheck:FileCheckTests", "Frontend:LLVMFrontendTests", "FuzzMutate:FuzzMutateTests", "IR:IRTests", diff --git a/utils/gn/secondary/llvm/unittests/CodeGen/GlobalISel/BUILD.gn b/utils/gn/secondary/llvm/unittests/CodeGen/GlobalISel/BUILD.gn index 5104716bccd..7933f8c7078 100644 --- a/utils/gn/secondary/llvm/unittests/CodeGen/GlobalISel/BUILD.gn +++ b/utils/gn/secondary/llvm/unittests/CodeGen/GlobalISel/BUILD.gn @@ -5,6 +5,7 @@ unittest("GlobalISelTests") { "//llvm/lib/CodeGen", "//llvm/lib/CodeGen/GlobalISel", "//llvm/lib/CodeGen/MIRParser", + "//llvm/lib/FileCheck", "//llvm/lib/IR", "//llvm/lib/MC", "//llvm/lib/Support", diff --git a/utils/gn/secondary/llvm/unittests/FileCheck/BUILD.gn b/utils/gn/secondary/llvm/unittests/FileCheck/BUILD.gn new file mode 100644 index 00000000000..85eef061d22 --- /dev/null +++ b/utils/gn/secondary/llvm/unittests/FileCheck/BUILD.gn @@ -0,0 +1,9 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("FileCheckTests") { + deps = [ + "//llvm/lib/FileCheck", + "//llvm/lib/Support", + ] + sources = [ "FileCheckTest.cpp" ] +} diff --git a/utils/gn/secondary/llvm/unittests/Support/BUILD.gn b/utils/gn/secondary/llvm/unittests/Support/BUILD.gn index be757feb2e9..f47e5a996b3 100644 --- a/utils/gn/secondary/llvm/unittests/Support/BUILD.gn +++ b/utils/gn/secondary/llvm/unittests/Support/BUILD.gn @@ -36,7 +36,6 @@ unittest("SupportTests") { "ErrorOrTest.cpp", "ErrorTest.cpp", "ExtensibleRTTITest.cpp", - "FileCheckTest.cpp", "FileCollectorTest.cpp", "FileOutputBufferTest.cpp", "FileUtilitiesTest.cpp",