This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mc] Add reportWarning() to MCContext
Changes PlannedPublic

Authored by bcain on Apr 25 2019, 8:03 AM.

Details

Summary

Adding reportWarning() to MCContext, so that it can be used from
the Hexagon assembler backend.

Diff Detail

Repository
rL LLVM

Event Timeline

bcain created this revision.Apr 25 2019, 8:03 AM
bcain updated this revision to Diff 197317.Apr 30 2019, 6:47 AM
bcain changed the repository for this revision from rL LLVM to rG LLVM Github Monorepo.

Add context, add clang update.

Herald added a project: Restricted Project. · View Herald TranscriptApr 30 2019, 6:47 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
bcain added a comment.May 3 2019, 7:16 AM

ping! any comments or concerns about this change?

bcain added a comment.May 7 2019, 9:26 AM

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
sidneym accepted this revision.May 8 2019, 8:11 AM

LGTM

This revision is now accepted and ready to land.May 8 2019, 8:11 AM
bcain planned changes to this revision.Jun 24 2020, 7:31 AM