From f719b4ae6e92153a3540845aabcc01232ee8b368 Mon Sep 17 00:00:00 2001 From: peter klausler Date: Mon, 1 Apr 2019 15:02:23 -0700 Subject: [PATCH] [flang] Revert to AsFortran in module file output. Original-commit: flang-compiler/f18@3dc7f685d177788f8f13d97d7e03aa00720f4730 Reviewed-on: https://github.com/flang-compiler/f18/pull/371 --- flang/lib/semantics/mod-file.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flang/lib/semantics/mod-file.cc b/flang/lib/semantics/mod-file.cc index 5901b92..ffa522a 100644 --- a/flang/lib/semantics/mod-file.cc +++ b/flang/lib/semantics/mod-file.cc @@ -437,13 +437,13 @@ void PutTypeParam(std::ostream &os, const Symbol &symbol) { void PutInit(std::ostream &os, const MaybeExpr &init) { if (init) { - os << '=' << init; + init->AsFortran(os << '='); } } void PutInit(std::ostream &os, const MaybeIntExpr &init) { if (init) { - os << '=' << init; + init->AsFortran(os << '='); } } @@ -453,7 +453,7 @@ void PutBound(std::ostream &os, const Bound &x) { } else if (x.isDeferred()) { os << ':'; } else { - os << x.GetExplicit(); + x.GetExplicit()->AsFortran(os); } } @@ -482,7 +482,7 @@ std::ostream &PutAttrs(std::ostream &os, Attrs attrs, const MaybeExpr &bindName, attrs.set(Attr::PUBLIC, false); // no need to write PUBLIC attrs.set(Attr::EXTERNAL, false); // no need to write EXTERNAL if (bindName) { - os << before << "bind(c, name=" << bindName << ')' << after; + bindName->AsFortran(os << before << "bind(c, name=") << ')' << after; attrs.set(Attr::BIND_C, false); } for (std::size_t i{0}; i < Attr_enumSize; ++i) { -- 2.7.4