[libclc] [libclc] Fix commands in compile_to_bc are executed sequentially (PR #130755)

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 26 06:16:44 PDT 2025


================
@@ -63,13 +65,15 @@ function(compile_to_bc)
       ${ARG_DEPENDENCIES}
     DEPFILE ${ARG_OUTPUT}.d
   )
+  add_custom_target( ${ARG_TARGET} DEPENDS ${ARG_OUTPUT}${TMP_SUFFIX} )
----------------
frasercrmck wrote:

I don't think the (possibly) "temp" output (in the case of `.ll` files) should be given the honour of the `ARG_TARGET` target. The final output of this function should unconditionally have `ARG_TARGET`. That saves doing `-as` workarounds in other parts of the code. The `TARGET` name the user passes should be definitive, in other words.

Do we strictly need a target for the intermediate step too? If we do, we could have `${ARG_TARGET}${TMP_SUFFIX}` here. Then non-IR files get `ARG_TARGET` target, and then in the IR block below we create `ARG_TARGET` for that case.

https://github.com/llvm/llvm-project/pull/130755


More information about the cfe-commits mailing list