[PATCH] Fix tablegen cmake rule.

Reid Kleckner rnk at google.com
Fri May 8 09:44:52 PDT 2015


TableGen is supposed to ensure that the output file is deleted after a non-zero exit, even if it crashes. See lib/TableGen/Main.cpp and look for tool_output_file. Is our signal handler failing somehow? It might be worth debugging that. I know the signal handler is already super async-unsafe, but we should be able to limp along well enough to delete an output file.


================
Comment at: cmake/modules/TableGen.cmake:31-32
@@ -30,3 +30,4 @@
     ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
-    -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
+    -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp ||
+    { rm -f ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp && false \; }
     # The file in LLVM_TARGET_DEFINITIONS may be not in the current
----------------
I would be surprised if this shell expression works on Windows. =/

http://reviews.llvm.org/D9608

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list