[all-commits] [llvm/llvm-project] f97731: [Flang][Unit Test] Move the declaration of kindMap...

kiranchandramohan via All-commits all-commits at lists.llvm.org
Mon Dec 13 08:14:33 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f97731c76501788c61012156adfae138f4013500
      https://github.com/llvm/llvm-project/commit/f97731c76501788c61012156adfae138f4013500
  Author: Kiran Chandramohan <kiran.chandramohan at arm.com>
  Date:   2021-12-13 (Mon, 13 Dec 2021)

  Changed paths:
    M flang/unittests/Optimizer/Builder/CharacterTest.cpp
    M flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp

  Log Message:
  -----------
  [Flang][Unit Test] Move the declaration of kindMap to the class

kindMap variable is declared in the Setup function but passed as
a reference to the firBuilder class. The firBuilder is declared in
the class and hence its lifetime exceeds that of kindMap. This can
lead to undefined behaviour. Move the kindMap variable into the class
to avoid this.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: awarzynski

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




More information about the All-commits mailing list