[PATCH] D153907: [AIX] [TOC] Add -mtocdata/-mno-tocdata options on AIX
Alex Gatea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 27 13:46:12 PDT 2023
alexgatea added inline comments.
================
Comment at: clang/include/clang/Basic/DiagnosticFrontendKinds.td:93
InGroup<BackendWarningAttributes>;
+def warn_toc_unsupported_type : Warning<"The -mtocdata option is ignored "
+ "for %0 because %1.">, InGroup<BackendWarningAttributes>;
----------------
MaskRay wrote:
> More conventionally, we use a driver warning in `DiagnosticDriverKinds.td`. Please read https://llvm.org/docs/CodingStandards.html#error-and-warning-messages
>
> In Clang, the conventional message reads: `ignoring ... because ...`
The problem with the driver warning approach is that the code that performs the filtering will be in CodeGen/TargetInfo.cpp, AIXTargetCodeGenInfo::setTargetAttributes and it seems to me we won't have access to Driver. In TargetInfo.cpp all of the diagnostics I see are of the FrontendKind, and I am following the same approach.
================
Comment at: clang/include/clang/Driver/Options.td:2921
MarshallingInfoStringVector<CodeGenOpts<"PassPlugins">>;
+def mtocdata_EQ : CommaJoined<["-"], "mtocdata=">,
+ Flags<[CoreOption, CC1Option]>,
----------------
MaskRay wrote:
> Make sure AIX-specific options have `TargetSpecific` flag.
These are not meant to be target-specific to AIX. It's just that this patch only implements setTargetAttributes on AIX; on other platforms we would like these options to simply be ignored.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153907/new/
https://reviews.llvm.org/D153907
More information about the llvm-commits
mailing list