Skip to content

Commit ca2100f

Browse files
schweitzpgijeanPerier
authored andcommitted
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 cf6e453 commit ca2100f

File tree

6 files changed

+769
-204
lines changed

6 files changed

+769
-204
lines changed

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

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

360+
/// Dump the current function. (debug)
361+
LLVM_DUMP_METHOD void dumpFunc();
362+
360363
private:
361364
const KindMapping &kindMap;
362365
};

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);
@@ -5659,7 +5658,7 @@ class ArrayExprLowering {
56595658
"array constructor element has unknown size");
56605659
});
56615660
auto newEleTy = fir::CharacterType::getSingleton(eleTy.getContext(),
5662-
charTy.getFKind());
5661+
charTy.getFKind());
56635662
if (auto seqTy = resTy.dyn_cast<fir::SequenceType>()) {
56645663
assert(eleTy == seqTy.getEleTy());
56655664
resTy = fir::SequenceType::get(seqTy.getShape(), newEleTy);

0 commit comments

Comments
 (0)