[llvm] TargetMachine: Remove pointer-size query methods (PR #226404)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 27 19:00:09 PDT 2026
https://github.com/MaskRay approved this pull request.
OK, getting rid of `TargetMachine::DL` is the goal. #226404 moves every reader off it, and the next PR in the stack, #226407, deletes the field. Most targets don't take the layout string from a caller. It comes from CodeGenTargetMachineImpl.cpp:97:
```
TargetMachine(T, TT.computeDataLayout(Options.MCOptions.getABIName()), TT, ...)
```
So TM.DL is a layout the TargetMachine computes for itself from triple + MCTargetOptions::ABIName, and the Module carries its own layout alongside it. Today they can't silently diverge, because MachineFunction.cpp:249 calls report_fatal_error if !TM.isCompatibleDataLayout(M.getDataLayout()), which is an exact equality check. So the pointer-size shims don't return wrong answers now.
https://github.com/llvm/llvm-project/pull/226404
More information about the llvm-commits
mailing list