Skip to content

Commit

Permalink
[flang] Add operator<< for parser::CharBlock
Browse files Browse the repository at this point in the history
Original-commit: flang-compiler/f18@439326d
Reviewed-on: flang-compiler/f18#630
Tree-same-pre-rewrite: false
  • Loading branch information
tskeith committed Aug 7, 2019
1 parent d1d63f3 commit 8067868
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 6 additions & 0 deletions flang/lib/parser/char-block.h
Expand Up @@ -21,6 +21,7 @@
#include <algorithm>
#include <cstddef>
#include <cstring>
#include <iosfwd>
#include <string>
#include <utility>

Expand Down Expand Up @@ -138,6 +139,11 @@ inline bool operator>=(const char *left, const CharBlock &right) {
inline bool operator>(const char *left, const CharBlock &right) {
return right < left;
}

inline std::ostream &operator<<(std::ostream &os, const CharBlock &x) {
return os << x.ToString();
}

}

// Specializations to enable std::unordered_map<CharBlock, ...> &c.
Expand Down
4 changes: 1 addition & 3 deletions flang/lib/parser/parse-tree.cc
Expand Up @@ -244,9 +244,7 @@ CharBlock Variable::GetSource() const {
std::ostream &operator<<(std::ostream &os, const Name &x) {
return os << x.ToString();
}
std::ostream &operator<<(std::ostream &os, const CharBlock &x) {
return os << x.ToString();
}

}

template class std::unique_ptr<Fortran::evaluate::GenericExprWrapper>;
4 changes: 0 additions & 4 deletions flang/lib/semantics/symbol.cc
Expand Up @@ -20,10 +20,6 @@

namespace Fortran::semantics {

std::ostream &operator<<(std::ostream &os, const parser::CharBlock &name) {
return os << name.ToString();
}

template<typename T>
static void DumpOptional(std::ostream &os, const char *label, const T &x) {
if (x) {
Expand Down

0 comments on commit 8067868

Please sign in to comment.