From 9668e45b61de5ae468f19ed25b49c87504486158 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 14 May 2018 19:23:31 +0000 Subject: [PATCH] Inline a few CMake variables into their only uses. No behavior change. Makes unittests CMakeLists.txt files more self-consistent. llvm-svn: 332280 --- llvm/unittests/ADT/CMakeLists.txt | 6 +----- llvm/unittests/CodeGen/CMakeLists.txt | 6 +----- llvm/unittests/DebugInfo/CodeView/CMakeLists.txt | 6 +----- llvm/unittests/DebugInfo/DWARF/CMakeLists.txt | 6 +----- llvm/unittests/DebugInfo/MSF/CMakeLists.txt | 6 +----- llvm/unittests/DebugInfo/PDB/CMakeLists.txt | 6 +----- llvm/unittests/Demangle/CMakeLists.txt | 6 +----- llvm/unittests/IR/CMakeLists.txt | 6 +----- llvm/unittests/Linker/CMakeLists.txt | 6 +----- llvm/unittests/XRay/CMakeLists.txt | 6 +----- 10 files changed, 10 insertions(+), 50 deletions(-) diff --git a/llvm/unittests/ADT/CMakeLists.txt b/llvm/unittests/ADT/CMakeLists.txt index d11bdc7a6b2c..8f0d176c3578 100644 --- a/llvm/unittests/ADT/CMakeLists.txt +++ b/llvm/unittests/ADT/CMakeLists.txt @@ -2,7 +2,7 @@ set(LLVM_LINK_COMPONENTS Support ) -set(ADTSources +add_llvm_unittest(ADTTests APFloatTest.cpp APIntTest.cpp APSIntTest.cpp @@ -65,10 +65,6 @@ set(ADTSources TripleTest.cpp TwineTest.cpp VariadicFunctionTest.cpp - ) - -add_llvm_unittest(ADTTests - ${ADTSources} ) add_dependencies(ADTTests intrinsics_gen) diff --git a/llvm/unittests/CodeGen/CMakeLists.txt b/llvm/unittests/CodeGen/CMakeLists.txt index 05b72ce05b7b..3a9112740e0a 100644 --- a/llvm/unittests/CodeGen/CMakeLists.txt +++ b/llvm/unittests/CodeGen/CMakeLists.txt @@ -8,7 +8,7 @@ set(LLVM_LINK_COMPONENTS Target ) -set(CodeGenSources +add_llvm_unittest(CodeGenTests DIEHashTest.cpp LowLevelTypeTest.cpp MachineInstrBundleIteratorTest.cpp @@ -17,8 +17,4 @@ set(CodeGenSources ScalableVectorMVTsTest.cpp ) -add_llvm_unittest(CodeGenTests - ${CodeGenSources} - ) - add_subdirectory(GlobalISel) diff --git a/llvm/unittests/DebugInfo/CodeView/CMakeLists.txt b/llvm/unittests/DebugInfo/CodeView/CMakeLists.txt index d06ccfaba72a..70a7b8af1447 100644 --- a/llvm/unittests/DebugInfo/CodeView/CMakeLists.txt +++ b/llvm/unittests/DebugInfo/CodeView/CMakeLists.txt @@ -2,14 +2,10 @@ set(LLVM_LINK_COMPONENTS DebugInfoCodeView ) -set(DebugInfoCodeViewSources +add_llvm_unittest(DebugInfoCodeViewTests RandomAccessVisitorTest.cpp TypeHashingTest.cpp TypeIndexDiscoveryTest.cpp ) -add_llvm_unittest(DebugInfoCodeViewTests - ${DebugInfoCodeViewSources} - ) - target_link_libraries(DebugInfoCodeViewTests PRIVATE LLVMTestingSupport) diff --git a/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt b/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt index f8ebedf7c344..d97e573ea38f 100644 --- a/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt +++ b/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt @@ -8,7 +8,7 @@ set(LLVM_LINK_COMPONENTS Support ) -set(DebugInfoSources +add_llvm_unittest(DebugInfoDWARFTests DwarfGenerator.cpp DwarfUtils.cpp DWARFDebugInfoTest.cpp @@ -16,8 +16,4 @@ set(DebugInfoSources DWARFFormValueTest.cpp ) -add_llvm_unittest(DebugInfoDWARFTests - ${DebugInfoSources} - ) - target_link_libraries(DebugInfoDWARFTests PRIVATE LLVMTestingSupport) diff --git a/llvm/unittests/DebugInfo/MSF/CMakeLists.txt b/llvm/unittests/DebugInfo/MSF/CMakeLists.txt index 20f3b2ab3dcd..0e48ab8f2f6b 100644 --- a/llvm/unittests/DebugInfo/MSF/CMakeLists.txt +++ b/llvm/unittests/DebugInfo/MSF/CMakeLists.txt @@ -2,14 +2,10 @@ set(LLVM_LINK_COMPONENTS DebugInfoMSF ) -set(DebugInfoMSFSources +add_llvm_unittest(DebugInfoMSFTests MappedBlockStreamTest.cpp MSFBuilderTest.cpp MSFCommonTest.cpp ) -add_llvm_unittest(DebugInfoMSFTests - ${DebugInfoMSFSources} - ) - target_link_libraries(DebugInfoMSFTests PRIVATE LLVMTestingSupport) diff --git a/llvm/unittests/DebugInfo/PDB/CMakeLists.txt b/llvm/unittests/DebugInfo/PDB/CMakeLists.txt index b19ee2cf43a5..5410e5f895d4 100644 --- a/llvm/unittests/DebugInfo/PDB/CMakeLists.txt +++ b/llvm/unittests/DebugInfo/PDB/CMakeLists.txt @@ -4,14 +4,10 @@ set(LLVM_LINK_COMPONENTS DebugInfoPDB ) -set(DebugInfoPDBSources +add_llvm_unittest(DebugInfoPDBTests HashTableTest.cpp StringTableBuilderTest.cpp PDBApiTest.cpp ) -add_llvm_unittest(DebugInfoPDBTests - ${DebugInfoPDBSources} - ) - target_link_libraries(DebugInfoPDBTests PRIVATE LLVMTestingSupport) diff --git a/llvm/unittests/Demangle/CMakeLists.txt b/llvm/unittests/Demangle/CMakeLists.txt index 4bf3699a8fde..3633d3212eb0 100644 --- a/llvm/unittests/Demangle/CMakeLists.txt +++ b/llvm/unittests/Demangle/CMakeLists.txt @@ -2,10 +2,6 @@ set(LLVM_LINK_COMPONENTS Demangle ) -set(DemangleSources +add_llvm_unittest(DemangleTests PartialDemangleTest.cpp ) - -add_llvm_unittest(DemangleTests - ${DemangleSources} -) diff --git a/llvm/unittests/IR/CMakeLists.txt b/llvm/unittests/IR/CMakeLists.txt index b04b0970cd6f..17aba85e6216 100644 --- a/llvm/unittests/IR/CMakeLists.txt +++ b/llvm/unittests/IR/CMakeLists.txt @@ -6,7 +6,7 @@ set(LLVM_LINK_COMPONENTS Passes ) -set(IRSources +add_llvm_unittest(IRTests AsmWriterTest.cpp AttributesTest.cpp BasicBlockTest.cpp @@ -40,7 +40,3 @@ set(IRSources VerifierTest.cpp WaymarkTest.cpp ) - -add_llvm_unittest(IRTests - ${IRSources} - ) diff --git a/llvm/unittests/Linker/CMakeLists.txt b/llvm/unittests/Linker/CMakeLists.txt index 05f45c0a8ce8..e94f4be8a2e9 100644 --- a/llvm/unittests/Linker/CMakeLists.txt +++ b/llvm/unittests/Linker/CMakeLists.txt @@ -4,10 +4,6 @@ set(LLVM_LINK_COMPONENTS linker ) -set(LinkerSources +add_llvm_unittest(LinkerTests LinkModulesTest.cpp ) - -add_llvm_unittest(LinkerTests - ${LinkerSources} - ) diff --git a/llvm/unittests/XRay/CMakeLists.txt b/llvm/unittests/XRay/CMakeLists.txt index 30bccd1bbe62..9872c901d137 100644 --- a/llvm/unittests/XRay/CMakeLists.txt +++ b/llvm/unittests/XRay/CMakeLists.txt @@ -2,12 +2,8 @@ set(LLVM_LINK_COMPONENTS Support ) -set(XRAYSources - GraphTest.cpp - ) - add_llvm_unittest(XRayTests - ${XRAYSources} + GraphTest.cpp ) add_dependencies(XRayTests intrinsics_gen)