<div dir="ltr">Thanks!</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 13, 2017 at 4:18 AM Galina Kistanova via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: gkistanova<br>
Date: Mon Jun 12 14:17:55 2017<br>
New Revision: 305222<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=305222&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=305222&view=rev</a><br>
Log:<br>
Addressed Takumi's comment about redundancy.<br>
<br>
Modified:<br>
    llvm/trunk/cmake/modules/TableGen.cmake<br>
<br>
Modified: llvm/trunk/cmake/modules/TableGen.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=305222&r1=305221&r2=305222&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=305222&r1=305221&r2=305222&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/cmake/modules/TableGen.cmake (original)<br>
+++ llvm/trunk/cmake/modules/TableGen.cmake Mon Jun 12 14:17:55 2017<br>
@@ -35,38 +35,24 @@ function(tablegen project ofn)<br>
   # a tablegen change, as cmake does not propagate file-level dependencies<br>
   # of custom targets. See the following ticket for more information:<br>
   # <a href="https://cmake.org/Bug/view.php?id=15858" rel="noreferrer" target="_blank">https://cmake.org/Bug/view.php?id=15858</a><br>
-  # We could always have just one dependency on both the target and<br>
-  # the file, but these 2 cases would produce cleaner cmake files.<br>
-  if ("${${project}_TABLEGEN_TARGET}" STREQUAL "${${project}_TABLEGEN_EXE}")<br>
-    add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp<br>
-      # Generate tablegen output in a temporary file.<br>
-      COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}<br>
-      ${LLVM_TABLEGEN_FLAGS}<br>
-      ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}<br>
-      -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp<br>
-      # The file in LLVM_TARGET_DEFINITIONS may be not in the current<br>
-      # directory and local_tds may not contain it, so we must<br>
-      # explicitly list it here:<br>
-      DEPENDS ${${project}_TABLEGEN_TARGET} ${local_tds} ${global_tds}<br>
-      ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}<br>
-      COMMENT "Building ${ofn}..."<br>
-      )<br>
-  else()<br>
-    add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp<br>
-      # Generate tablegen output in a temporary file.<br>
-      COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}<br>
-      ${LLVM_TABLEGEN_FLAGS}<br>
-      ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}<br>
-      -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp<br>
-      # The file in LLVM_TARGET_DEFINITIONS may be not in the current<br>
-      # directory and local_tds may not contain it, so we must<br>
-      # explicitly list it here:<br>
-      DEPENDS ${${project}_TABLEGEN_TARGET} ${${project}_TABLEGEN_EXE}<br>
-        ${local_tds} ${global_tds}<br>
-      ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}<br>
-      COMMENT "Building ${ofn}..."<br>
-      )<br>
-  endif()<br>
+  # The dependency on both, the target and the file, produces the same<br>
+  # dependency twice in the result file when<br>
+  # ("${${project}_TABLEGEN_TARGET}" STREQUAL "${${project}_TABLEGEN_EXE}")<br>
+  # but lets us having smaller and cleaner code here.<br>
+  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp<br>
+    # Generate tablegen output in a temporary file.<br>
+    COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}<br>
+    ${LLVM_TABLEGEN_FLAGS}<br>
+    ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}<br>
+    -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp<br>
+    # The file in LLVM_TARGET_DEFINITIONS may be not in the current<br>
+    # directory and local_tds may not contain it, so we must<br>
+    # explicitly list it here:<br>
+    DEPENDS ${${project}_TABLEGEN_TARGET} ${${project}_TABLEGEN_EXE}<br>
+      ${local_tds} ${global_tds}<br>
+    ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}<br>
+    COMMENT "Building ${ofn}..."<br>
+    )<br>
   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}<br>
     # Only update the real output file if there are any differences.<br>
     # This prevents recompilation of all the files depending on it if there<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>