[clang] clang-sycl-linker: Compute the DataLayout from the triple (PR #224376)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 17 11:00:55 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Matt Arsenault (arsenm)
<details>
<summary>Changes</summary>
Seed the module's DataLayout from the target triple directly rather than from
TargetMachine::createDataLayout().
Co-authored-by: Claude (Claude-Opus-4.8) <noreply@<!-- -->anthropic.com>
---
Full diff: https://github.com/llvm/llvm-project/pull/224376.diff
1 Files Affected:
- (modified) clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp (+1-1)
``````````diff
diff --git a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
index 70afc6d6c4cea..0f05de29f5118 100644
--- a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+++ b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
@@ -652,7 +652,7 @@ static Error runCodeGen(StringRef File, const llvm::Triple &TargetTriple,
// Set data layout if needed.
if (M->getDataLayout().isDefault())
- M->setDataLayout(TM->createDataLayout());
+ M->setDataLayout(TargetTriple.computeDataLayout());
// Open output file for writing.
int FD = -1;
``````````
</details>
https://github.com/llvm/llvm-project/pull/224376
More information about the cfe-commits
mailing list