Skip to content

Use Triple overload for target machine creation#1323

Closed
cervoliu wants to merge 1 commit into
AliveToolkit:masterfrom
cervoliu:codex-fix-target-machine-triple
Closed

Use Triple overload for target machine creation#1323
cervoliu wants to merge 1 commit into
AliveToolkit:masterfrom
cervoliu:codex-fix-target-machine-triple

Conversation

@cervoliu

Copy link
Copy Markdown
Contributor

Summary

Use the non-deprecated llvm::Triple overload of codegen::createTargetMachineForTriple in llvm_util::optimize_module.

Root Cause

Current LLVM headers deprecate the StringRef overload of createTargetMachineForTriple in favor of the Triple overload. Alive2 builds with -Werror, so the deprecation warning stops the build in llvm_util/llvm_optimizer.cpp.

Impact

This keeps Alive2 building against current LLVM without changing target machine selection behavior.

Validation

  • cmake --build build
  • ctest --test-dir build --show-only showed no configured CTest tests in this build tree.

@cervoliu cervoliu marked this pull request as ready for review June 27, 2026 11:34
Copilot AI review requested due to automatic review settings June 27, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates llvm_util::optimize_module to construct the LLVM target machine using the non-deprecated llvm::Triple overload of codegen::createTargetMachineForTriple, avoiding deprecation warnings that break builds when -Werror is enabled.

Changes:

  • Replace the deprecated StringRef-based call (ModuleTriple.str()) with the llvm::Triple overload (ModuleTriple) when creating the target machine.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cervoliu cervoliu marked this pull request as draft June 27, 2026 11:39
@cervoliu cervoliu closed this Jun 27, 2026
@cervoliu cervoliu deleted the codex-fix-target-machine-triple branch June 27, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants