[all-commits] [llvm/llvm-project] 906784: [flang] move getKindMapping() calls out of FIROpBu...

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Jul 12 00:24:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 906784a399069f0829b28273c027fbe36be40ce9
      https://github.com/llvm/llvm-project/commit/906784a399069f0829b28273c027fbe36be40ce9
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M flang/lib/Optimizer/CodeGen/BoxedProcedure.cpp
    M flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
    M flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp

  Log Message:
  -----------
  [flang] move getKindMapping() calls out of FIROpBuilder ctor calls

FirOpBuilder takes a fir::KindMapping reference. When the getKindMapping()
call is made inside the ctor call, the lifetime of this reference may
be as short as the ctor call (at least with when building flang in
release mode with clang 8). This can cause segfaults when later using
the FirOpBuilder.

Ensure the kindMap passed to the FirOpBuilder ctor is the same as the
FirOpBuilder.

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




More information about the All-commits mailing list