From 8ef5f88f101d9ef8b4c52439ca9029d770e69b5d Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 27 Jun 2026 18:30:10 +0800 Subject: [PATCH] Use new triple API --- CMakeLists.txt | 2 +- llvm_util/llvm_optimizer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f6f4a616..64a341d8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,7 +256,7 @@ install(TARGETS alive alive-jobserver) #add_library(alive2 SHARED ${IR_SRCS} ${SMT_SRCS} ${TOOLS_SRCS} ${UTIL_SRCS} ${LLVM_UTIL_SRCS}) if (BUILD_LLVM_UTILS OR BUILD_TV) - llvm_map_components_to_libnames(llvm_libs support core irreader bitwriter analysis passes transformutils codegen AllTargetsCodeGens AllTargetsDescs AllTargetsInfos) + llvm_map_components_to_libnames(llvm_libs support core irreader bitwriter analysis passes transformutils codegen targetparser AllTargetsCodeGens AllTargetsDescs AllTargetsInfos) # target_link_libraries(alive2 PRIVATE ${llvm_libs}) target_link_libraries(alive-tv PRIVATE ${ALIVE_LIBS_LLVM} ${Z3_LIBRARIES} ${HIREDIS_LIBRARIES} ${llvm_libs}) target_link_libraries(quick-fuzz PRIVATE ${ALIVE_LIBS_LLVM} ${Z3_LIBRARIES} ${HIREDIS_LIBRARIES} ${llvm_libs}) diff --git a/llvm_util/llvm_optimizer.cpp b/llvm_util/llvm_optimizer.cpp index c37e7249d..d8cfb8c35 100644 --- a/llvm_util/llvm_optimizer.cpp +++ b/llvm_util/llvm_optimizer.cpp @@ -29,7 +29,7 @@ string optimize_module(llvm::Module &M, string_view optArgs) { Triple ModuleTriple(M.getTargetTriple()); unique_ptr TM; if (ModuleTriple.getArch()) { - auto ETM = codegen::createTargetMachineForTriple(ModuleTriple.str()); + auto ETM = codegen::createTargetMachineForTriple(ModuleTriple); if (auto E = ETM.takeError()) return toString(std::move(E)); TM = std::move(*ETM);