[PATCH] D119301: [AArch64][ARM] add -Wunaligned-access only for clang

Sam Elliott via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 9 14:06:03 PST 2022

lenary added a comment.

I don't fully understand the reasoning for the patch, and you haven't really explained it. I think what you are saying is that the `IsAux` argument to `getTargetFeatures` should be considered because it's `true` for offloading to another compiler, but I don't understand why we think the offload compiler is not clang-compatible, as the features added in `getAArch64TargetFeatures` and `getARMTargetFeatures` (and passed to the offloaded compiler) use the LLVM-specific internal names. I would like you to explain this further, and to document what `IsAux` implies in the code.

That all said code given here is not equivalent to the feature as originally landed, because you've only re-added the `-Wunaligned-access` flag for the AArch64 target - please make the same addition in `Clang::AddARMTargetArgs` as we want the warning on both. I think this also makes `CmdArgs` unused in both `aarch64::getAArch64TargetFeatures` and `arm::getARMTargetFeatures` as I think that you don't actually want us adding to `CmdArgs` in those functions (again, I hope the full reasoning behind this will be explained when you explain why the whole patch is necessary).

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list