Skip to content

Commit 94b58b2

Browse files
committed
Fix bugs arising from using functional values as objects in memory.
This adds code to allow DenseMaps of Expr values. The boilerplate implemetns the glue between the functional values of the front end and trying to use them in LLVM data structures.
1 parent 6eb7893 commit 94b58b2

File tree

6 files changed

+610
-45
lines changed

6 files changed

+610
-45
lines changed

flang/include/flang/Optimizer/Builder/FIRBuilder.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ class FirOpBuilder : public mlir::OpBuilder {
353353
mlir::Value ub, mlir::Value step,
354354
mlir::Type type);
355355

356+
/// Dump the current function. (debug)
357+
LLVM_DUMP_METHOD void dumpFunc();
358+
356359
private:
357360
const KindMapping &kindMap;
358361
};

flang/lib/Lower/ConvertExpr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,7 +2693,6 @@ class ScalarArrayExprLowering {
26932693
[&](const Fortran::evaluate::Subscript *x) { addSub(*x); },
26942694
[&](const Fortran::evaluate::ArrayRef *x) {
26952695
assert(!x->base().IsSymbol());
2696-
ty = addField(x->base().GetComponent());
26972696
for (const auto &sub : x->subscript())
26982697
addSub(sub);
26992698
ty = fir::unwrapSequenceType(ty);
@@ -5658,7 +5657,7 @@ class ArrayExprLowering {
56585657
"array constructor element has unknown size");
56595658
});
56605659
auto newEleTy = fir::CharacterType::getSingleton(eleTy.getContext(),
5661-
charTy.getFKind());
5660+
charTy.getFKind());
56625661
if (auto seqTy = resTy.dyn_cast<fir::SequenceType>()) {
56635662
assert(eleTy == seqTy.getEleTy());
56645663
resTy = fir::SequenceType::get(seqTy.getShape(), newEleTy);

0 commit comments

Comments
 (0)