[flang-commits] [flang] 7d1397f - Making FindCommonBlock a const member
via flang-commits
flang-commits at lists.llvm.org
Mon Feb 22 10:10:40 PST 2021
Author: Renaud-K
Date: 2021-02-22T10:10:11-08:00
New Revision: 7d1397f7ad4bbdad56468d5a4c7a77fa4c553936
URL: https://github.com/llvm/llvm-project/commit/7d1397f7ad4bbdad56468d5a4c7a77fa4c553936
DIFF: https://github.com/llvm/llvm-project/commit/7d1397f7ad4bbdad56468d5a4c7a77fa4c553936.diff
LOG: Making FindCommonBlock a const member
https://reviews.llvm.org/D97093
Added:
Modified:
flang/include/flang/Semantics/scope.h
flang/lib/Semantics/scope.cpp
Removed:
################################################################################
diff --git a/flang/include/flang/Semantics/scope.h b/flang/include/flang/Semantics/scope.h
index e547074ce094..81840bdb0122 100644
--- a/flang/include/flang/Semantics/scope.h
+++ b/flang/include/flang/Semantics/scope.h
@@ -169,7 +169,7 @@ class Scope {
mapType &commonBlocks() { return commonBlocks_; }
const mapType &commonBlocks() const { return commonBlocks_; }
Symbol &MakeCommonBlock(const SourceName &);
- Symbol *FindCommonBlock(const SourceName &);
+ Symbol *FindCommonBlock(const SourceName &) const;
/// Make a Symbol but don't add it to the scope.
template <typename D>
diff --git a/flang/lib/Semantics/scope.cpp b/flang/lib/Semantics/scope.cpp
index 901e655ffc20..597f554abcb9 100644
--- a/flang/lib/Semantics/scope.cpp
+++ b/flang/lib/Semantics/scope.cpp
@@ -149,7 +149,7 @@ Symbol &Scope::MakeCommonBlock(const SourceName &name) {
return symbol;
}
}
-Symbol *Scope::FindCommonBlock(const SourceName &name) {
+Symbol *Scope::FindCommonBlock(const SourceName &name) const {
const auto it{commonBlocks_.find(name)};
return it != commonBlocks_.end() ? &*it->second : nullptr;
}
More information about the flang-commits
mailing list