OSDN Git Service

Rename three cxx files in unittests to cpp.
authorNico Weber <nicolasweber@gmx.de>
Tue, 15 May 2018 16:30:30 +0000 (16:30 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 15 May 2018 16:30:30 +0000 (16:30 +0000)
LLVM uses cpp as its C++ file extension, these are the only three cxx file in
the monorepo. These files apparently were called to escape a CMake check -- use
the LLVM_OPTIONAL_SOURCES mechanism that's meant as an escape for this case
instead.

No intended behavior change.
https://reviews.llvm.org/D46843

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332368 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Passes/CMakeLists.txt
unittests/Passes/TestPlugin.cpp [moved from unittests/Passes/TestPlugin.cxx with 94% similarity]
unittests/Support/DynamicLibrary/CMakeLists.txt
unittests/Support/DynamicLibrary/ExportedFuncs.cpp [moved from unittests/Support/DynamicLibrary/ExportedFuncs.cxx with 84% similarity]
unittests/Support/DynamicLibrary/PipSqueak.cpp [moved from unittests/Support/DynamicLibrary/PipSqueak.cxx with 92% similarity]

index 46fb197..c29f098 100644 (file)
@@ -1,3 +1,6 @@
+# Needed by LLVM's CMake checks because this file defines multiple targets.
+set(LLVM_OPTIONAL_SOURCES TestPlugin.cpp)
+
 set(LLVM_LINK_COMPONENTS Support Passes Core)
 
 # If plugins are disabled, this test will disable itself at runtime. Otherwise,
@@ -9,7 +12,7 @@ endif()
 add_llvm_unittest(PluginsTests PluginsTest.cpp)
 export_executable_symbols(PluginsTests)
 
-add_library(TestPlugin MODULE TestPlugin.cxx)
+add_library(TestPlugin MODULE TestPlugin.cpp)
 
 set_output_directory(TestPlugin
   BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
similarity index 94%
rename from unittests/Passes/TestPlugin.cxx
rename to unittests/Passes/TestPlugin.cpp
index adb666e..2ba6f9b 100644 (file)
@@ -1,4 +1,4 @@
-//===- unittests/Passes/Plugins/Plugin.cxx --------------------------------===//
+//===- unittests/Passes/Plugins/Plugin.cpp --------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
index 4f060e4..7960326 100644 (file)
@@ -1,6 +1,9 @@
+# Needed by LLVM's CMake checks because this file defines multiple targets.
+set(LLVM_OPTIONAL_SOURCES ExportedFuncs.cpp PipSqueak.cpp)
+
 set(LLVM_LINK_COMPONENTS Support)
 
-add_library(DynamicLibraryLib STATIC ExportedFuncs.cxx)
+add_library(DynamicLibraryLib STATIC ExportedFuncs.cpp)
 set_target_properties(DynamicLibraryLib PROPERTIES FOLDER "Tests")
 
 add_llvm_unittest(DynamicLibraryTests DynamicLibraryTest.cpp)
@@ -8,7 +11,7 @@ target_link_libraries(DynamicLibraryTests PRIVATE DynamicLibraryLib)
 export_executable_symbols(DynamicLibraryTests)
 
 function(dynlib_add_module NAME)
-  add_library(${NAME} SHARED PipSqueak.cxx)
+  add_library(${NAME} SHARED PipSqueak.cpp)
   set_target_properties(${NAME} PROPERTIES FOLDER "Tests")
 
   set_output_directory(${NAME}
@@ -1,4 +1,4 @@
-//===- llvm/unittest/Support/DynamicLibrary/DynamicLibraryLib.cpp ---------===//
+//===- llvm/unittest/Support/DynamicLibrary/ExportedFuncs.cpp -------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -1,4 +1,4 @@
-//===- llvm/unittest/Support/DynamicLibrary/PipSqueak.cxx -----------------===//
+//===- llvm/unittest/Support/DynamicLibrary/PipSqueak.cpp -----------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -46,4 +46,4 @@ extern "C" PIPSQUEAK_EXPORT void TestOrder(std::vector<std::string> &V) {
 }
 
 #define PIPSQUEAK_TESTA_RETURN "LibCall"
-#include "ExportedFuncs.cxx"
+#include "ExportedFuncs.cpp"