diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Print.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 5c8463f78..0b15477ee 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -106,6 +106,14 @@ static Type forceConcrete(Type type) { return type.isConcrete() ? type : Type::i32; } +// Whatever type we print must be valid for the alignment. +static Type forceConcrete(Type type, Index align) { + return type.isConcrete() ? type + : align >= 16 ? Type::v128 + : align >= 8 ? Type::i64 + : Type::i32; +} + struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { std::ostream& o; unsigned indent = 0; @@ -538,7 +546,7 @@ struct PrintExpressionContents curr->name.print(o); } void visitLoad(Load* curr) { - prepareColor(o) << forceConcrete(curr->type); + prepareColor(o) << forceConcrete(curr->type, curr->align); if (curr->isAtomic) { o << ".atomic"; } |