aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorTom Eccles <tom.eccles@arm.com>2023-06-01 11:09:45 +0000
committerTom Eccles <tom.eccles@arm.com>2023-06-05 09:57:57 +0000
commit53cc33b00b5bf5cec5de214c1566289c927a83ca (patch)
treecac0670490a3227f8e606f77fcf2823f2dcda1cc /flang/lib/Frontend/CompilerInvocation.cpp
parent775de6754af8d5122f10204097f41be02c5c9f3b (diff)
downloadllvm-53cc33b00b5bf5cec5de214c1566289c927a83ca.zip
llvm-53cc33b00b5bf5cec5de214c1566289c927a83ca.tar.gz
llvm-53cc33b00b5bf5cec5de214c1566289c927a83ca.tar.bz2
[flang] Store KindMapping by value in FirOpBuilder
Previously only a constant reference was stored in the FirOpBuilder. However, a lot of code was merged using FirOpBuilder builder{rewriter, getKindMapping(mod)}; This is incorrect because the KindMapping returned will go out of scope as soon as FirOpBuilder's constructor had run. This led to an infinite loop running some tests using HLFIR (because the stack space containing the kind mapping was re-used and corrupted). One solution would have just been to fix the incorrect call sites, however, as a large number of these had already made it past review, I decided to instead change FirOpBuilder to store its own copy of the KindMapping. This is not costly because nearly every time we construct a KindMapping is exclusively to construct a FirOpBuilder. To make this common pattern simpler, I added a new constructor to FirOpBuilder which calls getKindMapping(). Differential Revision: https://reviews.llvm.org/D151881
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions