Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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).
Apologies for the lack of explanation. My point is that getAArch64TargetFeatures / getARMTargetFeatures should only get the TargetFeatures, not adding compiler flags as a side effect, which belongs to clang's job construction. This makes code reuse harder.
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).
Will do the same thing for Clang::AddARMTargetArgs. Thanks. I've tested this patch but not sure why the original test still passing without a Clang::AddARMTargetArgs change.
Ah, I see.
Please can you also remove the CmdArgs parameter from arm::getARMTargetFeatures when you commit this? This would be useful, along with a comment at the top of getTargetFeatures to discourage targets adding to or using CmdArgs in their get<Target>TargetFeatures functions.