[PATCH] D61130: [llvm-mc] Add reportWarning() to MCContext

Brian Cain via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 09:28:46 PDT 2019


bcain added a comment.

More context for this change:

- "`--no-warn`" is present already, target-independent, and it's supported by llvm-mc (and other MC tools) because it's already present in `include/llvm/MC/MCTargetOptionsCommandFlags.inc`.
- Only the AsmParser has access to the `MCTargetOptions` that contains `NoWarn`.
- This change adds a `MCTargetOptions *` to the `MCContext` so that assemblers can emit warnings outside of their `AsmParser` and still conform to `--no-warn`/`--fatal-warnings`.
- Hexagon has a check performed in its AsmBackend that can emit warnings, those warnings were not silenced by `--no-warn`.
- The `.warning` directive is already correctly silenced by `llvm-mc --no-warn` (but not `clang -Wa,--no-warn`).
- A corresponding change to `clang` has been added to support `-Wa,--no-warn` -- https://reviews.llvm.org/D61309


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61130/new/

https://reviews.llvm.org/D61130





More information about the cfe-commits mailing list