[all-commits] [llvm/llvm-project] a0226f: [flang] Dodge bogus uninitialized data warning fro...

Peter Klausler via All-commits all-commits at lists.llvm.org
Fri Jun 12 10:05:35 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a0226f9bffa4c879ec7f8183738205661978cc39
      https://github.com/llvm/llvm-project/commit/a0226f9bffa4c879ec7f8183738205661978cc39
  Author: peter klausler <pklausler at nvidia.com>
  Date:   2020-06-12 (Fri, 12 Jun 2020)

  Changed paths:
    M flang/documentation/ParserCombinators.md
    M flang/include/flang/Evaluate/traverse.h
    M flang/lib/Parser/Fortran-parsers.cpp
    M flang/lib/Parser/basic-parsers.h
    M flang/lib/Parser/program-parsers.cpp
    M flang/lib/Parser/stmt-parser.h
    M flang/lib/Parser/token-parsers.h

  Log Message:
  -----------
  [flang] Dodge bogus uninitialized data warning from gcc 10.1 via code cleanup

G++ 10.1 emits inappropriate "use of uninitialized data" warnings when
compiling f18.  The warnings stem from two sites in templatized code
whose multiple instantiations magnified the number of warnings.

These changes dodge those warnings by making some innocuous changes to
the code.  In the parser, the idiom defaulted(cut >> x), which yields a
parser that always succeeds, has been replaced with a new equivalent
pass<T>() parser that returns a default-constructed value T{} in an
arguably more readable fashion.  This idiom was the only attestation of
the basic parser cut, so it has been removed and the remaining code
simplified.  In Evaluate/traverse.h, a return {}; was replaced with a
return of a default-constructed member.

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




More information about the All-commits mailing list