[clang] [Clang] Suppress mismatch warning for same-size pointer/integer casts (PR #203955)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 24 09:03:58 PDT 2026
================
@@ -1057,6 +1057,12 @@ class TargetInfo : public TransferrableTargetInfo,
/// idea to avoid optimizing based on that undef behavior.
virtual bool isCLZForZeroUndef() const { return true; }
+ /// Returns whether pointers and integers of the same size are considered
+ /// ABI-compatible on this target. Defaults to true; targets with separate
+ /// register files for pointers and integers (e.g., m68k) should override
+ /// to return false.
+ virtual bool arePointersAndIntegersABICompatible() const { return true; }
----------------
AaronBallman wrote:
Thanks! You might want to hold off a little bit to see if we have other maintainers concerned about relaxing the diagnostic (I don't want to sign you up for busywork if the PR won't land anyway). But the targets Clang supports can be found at: https://github.com/llvm/llvm-project/tree/main/clang/lib/Basic/Targets
https://github.com/llvm/llvm-project/pull/203955
More information about the cfe-commits
mailing list