[all-commits] [llvm/llvm-project] 4fc3ac: clang-linker-wrapper: Set the host DataLayout on t...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Thu Sep 17 05:27:59 PDT 2026


  Branch: refs/heads/users/arsenm/clang/linker-wrapper-host-datalayout
  Home:   https://github.com/llvm/llvm-project
  Commit: 4fc3aca12aa21e58b98845dd39a463af3c324be2
      https://github.com/llvm/llvm-project/commit/4fc3aca12aa21e58b98845dd39a463af3c324be2
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-09-17 (Thu, 17 Sep 2026)

  Changed paths:
    A clang/test/OffloadTools/clang-linker-wrapper/linker-wrapper-host-datalayout.c
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

  Log Message:
  -----------
  clang-linker-wrapper: Set the host DataLayout on the offload wrapper module

The offload wrapper module was created with only a target triple, and the
datalayout wasn't set until later, where it was copied from the TargetMachine,
after the wrapping code already ran.

The wrapping code did query the datalayout for the pointer size, so this was
broken for host and devices with different pointer sizes.
queries the DataLayout (e.g. the size_t / intptr type via getSizeTTy), so on a
host whose pointer size differs from the default layout (e.g. a 32-bit host) it
used the wrong integer width for image offsets.

This removes a use of TargetMachine::createDataLayout, which I am trying to
remove.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list