This is an archive of the discontinued LLVM Phabricator instance.

[flang] Set red bold color for the keyword "fatal internal error"
AbandonedPublic

Authored by peixin on May 22 2022, 4:24 AM.

Details

Summary

Set red bold color for the keyword "fatal internal error".
Also fix several typos.

Diff Detail

Event Timeline

peixin created this revision.May 22 2022, 4:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2022, 4:24 AM
peixin requested review of this revision.May 22 2022, 4:24 AM

Please check the following example. This patch highlight the color for the "fatal internal error:" to red bold.

$ cat test.f90 
program m
contains
  subroutine sub()
    type my_type (k)
      integer, KIND :: k = 4
      integer :: x = 10
    end type
  end
end
$ bbc -emit-fir test.f90 

fatal internal error: node has not been analyzed:
Expr -> LiteralConstant -> IntLiteralConstant = '10'

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

BTW, there is one bug in semantic analysis for the derived type. Check https://github.com/llvm/llvm-project/blob/9d0d24eec44787b4a762d01866d0b9b733bee778/flang/lib/Semantics/resolve-names.cpp#L6678-L6686. It does not check if the symbol kind/len is from the parameter of derived type or intrinsic type. Will fix it later.

klausler accepted this revision.May 22 2022, 9:28 AM
klausler added inline comments.
flang/lib/Common/idioms.cpp
19

Unnecessary and nonportable, and should at least be sensitive to whether the standard error output is a terminal or not.

This revision is now accepted and ready to land.May 22 2022, 9:28 AM

@klausler I think you wanted to click "request change" instead of "approve", right?

@tschuett Thanks for the info.

This common::die does not use llvm ostream. Using it to set color in common::die will require more changes. Considering that @klausler thinks it is unnecessary, I will abandon this if no one wants to set color for the keyword.

peixin abandoned this revision.May 26 2022, 7:28 AM