[llvm-branch-commits] [llvm] 0c05269 - [nfc] Cleanup extension header generation

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jun 17 17:36:04 PDT 2020


Author: serge-sans-paille
Date: 2020-06-17T16:57:30-07:00
New Revision: 0c05269e0232d5eebfd835aa1401913b181031a3

URL: https://github.com/llvm/llvm-project/commit/0c05269e0232d5eebfd835aa1401913b181031a3
DIFF: https://github.com/llvm/llvm-project/commit/0c05269e0232d5eebfd835aa1401913b181031a3.diff

LOG: [nfc] Cleanup extension header generation

(cherry picked from commit f44a508df629ecc97e0b1345726b12f25927409e)

Added: 
    

Modified: 
    llvm/cmake/modules/AddLLVM.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 8fbb33a22fde..a8b3628fd311 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -937,17 +937,18 @@ function(process_llvm_pass_plugins)
           DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
           COMPONENT cmake-exports)
 
-      file(WRITE "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp" "//extension handlers\n")
+      set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def")
+      file(WRITE "${ExtensionDef}.tmp" "//extension handlers\n")
       foreach(llvm_extension ${LLVM_STATIC_EXTENSIONS})
-        file(APPEND "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp" "HANDLE_EXTENSION(${llvm_extension})\n")
+          file(APPEND "${ExtensionDef}.tmp" "HANDLE_EXTENSION(${llvm_extension})\n")
       endforeach()
-      file(APPEND "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp" "#undef HANDLE_EXTENSION\n")
+      file(APPEND "${ExtensionDef}.tmp" "#undef HANDLE_EXTENSION\n")
 
       # only replace if there's an actual change
       execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_
diff erent
-        "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp"
-        "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def")
-      file(REMOVE "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp")
+          "${ExtensionDef}.tmp"
+          "${ExtensionDef}")
+      file(REMOVE "${ExtensionDef}.tmp")
   endif()
 endfunction()
 


        


More information about the llvm-branch-commits mailing list