[clang] [llvm] [PowerPC] frontend get target feature from backend with cpu name (PR #137670)
zhijian lin via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 17 13:02:38 PDT 2025
================
@@ -8,6 +8,12 @@ if (HAS_WERROR_GLOBAL_CTORS AND NOT LLVM_HAS_NOGLOBAL_CTOR_MUTEX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=global-constructors")
endif()
+set(LLVM_TARGET_DEFINITIONS ${LLVM_MAIN_SRC_DIR}/lib/Target/PowerPC/PPC.td)
+
+tablegen(LLVM PPCGenSubtargetInfo.inc -gen-subtarget -I${LLVM_MAIN_SRC_DIR}/lib/Target/PowerPC)
+add_public_tablegen_target(PPCGenSubtargetInfo)
----------------
diggerlin wrote:
> Reusing the generated subtarget info doesn't seem right to me. I would feel more comfortable if this were handled along the same lines as the other Targets, which generate defs in the include/.../TargetParser directory: https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/TargetParser/CMakeLists.txt
>
> Let me roll this back for now to mitigate the risk of missing CMake dependencies.
I create the patch https://github.com/llvm/llvm-project/pull/144594 to address your comment.
https://github.com/llvm/llvm-project/pull/137670
More information about the llvm-commits
mailing list