aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Semantics/mod-file.cpp
diff options
context:
space:
mode:
authorTim Keith <tkeith@nvidia.com>2020-05-06 12:20:07 -0700
committerTim Keith <tkeith@nvidia.com>2020-05-06 12:22:28 -0700
commitd5c05ced82ff698fad3da0537cf9b7cdb38dce85 (patch)
tree14831f732860804443d2a0a2086811ee7d57f38f /flang/lib/Semantics/mod-file.cpp
parent947f78ac27f4ea52a443ba9d5983cfe3eaf51148 (diff)
downloadllvm-d5c05ced82ff698fad3da0537cf9b7cdb38dce85.zip
llvm-d5c05ced82ff698fad3da0537cf9b7cdb38dce85.tar.gz
llvm-d5c05ced82ff698fad3da0537cf9b7cdb38dce85.tar.bz2
[flang][NFC] Add accessors to equivalence and common blocks
Add a way to get mutable equivalence sets to Scope so that they can have sizes and offsets assigned to them. Change CommonBlockDetails to have mutable symbols so that they can have sizes and offets assigned to them. This also allows the removal of some `const_cast`s. Add MutableSymbolRef and MutableSymbolVector as mutable analogs to SymbolRef and SymbolVector. Replace uses of equivalent types with those names. Differential Revision: https://reviews.llvm.org/D79346
Diffstat (limited to 'flang/lib/Semantics/mod-file.cpp')
-rw-r--r--flang/lib/Semantics/mod-file.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp
index 8e95b82..d5b7548 100644
--- a/flang/lib/Semantics/mod-file.cpp
+++ b/flang/lib/Semantics/mod-file.cpp
@@ -243,8 +243,8 @@ void ModFileWriter::PutSymbol(
[&](const CommonBlockDetails &x) {
decls_ << "common/" << symbol.name();
char sep = '/';
- for (const Symbol &object : x.objects()) {
- decls_ << sep << object.name();
+ for (const auto &object : x.objects()) {
+ decls_ << sep << object->name();
sep = ',';
}
decls_ << '\n';
@@ -875,8 +875,8 @@ void SubprogramSymbolCollector::DoSymbol(
}
},
[this](const CommonBlockDetails &details) {
- for (const Symbol &object : details.objects()) {
- DoSymbol(object);
+ for (const auto &object : details.objects()) {
+ DoSymbol(*object);
}
},
[](const auto &) {},