[all-commits] [llvm/llvm-project] ef141a: [flang] Improve appearance of message attachments

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Apr 14 07:35:10 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ef141aec3c81b33bd2022f258e6ca8d4b1611fd3
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-04-14 (Thu, 14 Apr 2022)

  Changed paths:
    M flang/include/flang/Parser/message.h
    M flang/lib/Parser/message.cpp
    M flang/lib/Semantics/check-call.cpp
    M flang/lib/Semantics/check-select-rank.cpp
    M flang/lib/Semantics/expression.cpp
    M flang/lib/Semantics/resolve-names.cpp
    M flang/test/Semantics/call25.f90

  Log Message:
  [flang] Improve appearance of message attachments

Error messages can have a list of attachments; these are used to point
to related source locations, supply additional information, and to
encapsulate error messages that were *not* emitted in a given context
to explain why a warning was justified.

This patch adds a message severity ("Because") for that last case,
and extends to AttachTo() API to provide a means for overriding
the severity of an attached message.

Some existing message attachments had their severities adjusted,
now that we're printing them.  And operator==() for Message was
cleaned up while debugging after I noticed that it was recursively
O(N**2) and subject to returning a false positive.

Differential Revision: https://reviews.llvm.org/D123710

More information about the All-commits mailing list