summaryrefslogtreecommitdiff
path: root/flang
diff options
context:
space:
mode:
authorJean Perier <jperier@hsw1.pgi.net>2018-10-25 05:55:23 -0700
committerJean Perier <jperier@hsw1.pgi.net>2018-10-25 05:55:23 -0700
commitf7e7cb349b1f5c322a2e9eff16e6e81b8d70807b (patch)
tree918cd1101a1ea8b4d577339fd05efeddef9fc53e /flang
parent9077dc289ba3d12ff855442c48f568465c18c7ac (diff)
downloadllvm-f7e7cb349b1f5c322a2e9eff16e6e81b8d70807b.tar.gz
[flang] Changed .clang-format so that it will not add a comment after the closing brace of each namespace. Removed all such previous comments from all .cc and .h files
Original-commit: flang-compiler/f18@aa7f55e15f78909ba8401f85e023ee4c3eaa923f Reviewed-on: https://github.com/flang-compiler/f18/pull/217
Diffstat (limited to 'flang')
-rw-r--r--flang/.clang-format1
-rw-r--r--flang/include/flang/ISO_Fortran_binding.h6
-rw-r--r--flang/lib/common/bit-population-count.h2
-rw-r--r--flang/lib/common/constexpr-bitset.h2
-rw-r--r--flang/lib/common/enum-set.h2
-rw-r--r--flang/lib/common/fortran.h3
-rw-r--r--flang/lib/common/idioms.cc2
-rw-r--r--flang/lib/common/idioms.h5
-rw-r--r--flang/lib/common/indirection.h3
-rw-r--r--flang/lib/common/interval.h3
-rw-r--r--flang/lib/common/reference-counted.h3
-rw-r--r--flang/lib/common/template.h3
-rw-r--r--flang/lib/evaluate/call.cc3
-rw-r--r--flang/lib/evaluate/call.h3
-rw-r--r--flang/lib/evaluate/common.cc3
-rw-r--r--flang/lib/evaluate/common.h3
-rw-r--r--flang/lib/evaluate/complex.cc2
-rw-r--r--flang/lib/evaluate/complex.h3
-rw-r--r--flang/lib/evaluate/expression.cc5
-rw-r--r--flang/lib/evaluate/expression.h3
-rw-r--r--flang/lib/evaluate/int-power.h3
-rw-r--r--flang/lib/evaluate/integer.cc3
-rw-r--r--flang/lib/evaluate/integer.h2
-rw-r--r--flang/lib/evaluate/intrinsics.cc3
-rw-r--r--flang/lib/evaluate/intrinsics.h2
-rw-r--r--flang/lib/evaluate/leading-zero-bit-count.h6
-rw-r--r--flang/lib/evaluate/logical.cc3
-rw-r--r--flang/lib/evaluate/logical.h2
-rw-r--r--flang/lib/evaluate/real.cc2
-rw-r--r--flang/lib/evaluate/real.h3
-rw-r--r--flang/lib/evaluate/rounding-bits.h2
-rw-r--r--flang/lib/evaluate/tools.cc3
-rw-r--r--flang/lib/evaluate/tools.h3
-rw-r--r--flang/lib/evaluate/type.cc2
-rw-r--r--flang/lib/evaluate/type.h5
-rw-r--r--flang/lib/evaluate/variable.cc3
-rw-r--r--flang/lib/evaluate/variable.h3
-rw-r--r--flang/lib/parser/basic-parsers.h3
-rw-r--r--flang/lib/parser/char-block.h3
-rw-r--r--flang/lib/parser/char-buffer.cc3
-rw-r--r--flang/lib/parser/char-buffer.h3
-rw-r--r--flang/lib/parser/char-set.cc3
-rw-r--r--flang/lib/parser/char-set.h3
-rw-r--r--flang/lib/parser/characters.cc2
-rw-r--r--flang/lib/parser/characters.h3
-rw-r--r--flang/lib/parser/debug-parser.cc3
-rw-r--r--flang/lib/parser/debug-parser.h3
-rw-r--r--flang/lib/parser/features.h3
-rw-r--r--flang/lib/parser/format-specification.h3
-rw-r--r--flang/lib/parser/grammar.h2
-rw-r--r--flang/lib/parser/instrumented-parser.cc3
-rw-r--r--flang/lib/parser/instrumented-parser.h3
-rw-r--r--flang/lib/parser/message.cc3
-rw-r--r--flang/lib/parser/message.h4
-rw-r--r--flang/lib/parser/openmp-grammar.h3
-rw-r--r--flang/lib/parser/parse-state.h3
-rw-r--r--flang/lib/parser/parse-tree-visitor.h3
-rw-r--r--flang/lib/parser/parse-tree.cc3
-rw-r--r--flang/lib/parser/parse-tree.h9
-rw-r--r--flang/lib/parser/parsing.cc3
-rw-r--r--flang/lib/parser/parsing.h3
-rw-r--r--flang/lib/parser/preprocessor.cc3
-rw-r--r--flang/lib/parser/preprocessor.h3
-rw-r--r--flang/lib/parser/prescan.cc3
-rw-r--r--flang/lib/parser/prescan.h3
-rw-r--r--flang/lib/parser/provenance.cc3
-rw-r--r--flang/lib/parser/provenance.h3
-rw-r--r--flang/lib/parser/source.cc3
-rw-r--r--flang/lib/parser/source.h3
-rw-r--r--flang/lib/parser/stmt-parser.h3
-rw-r--r--flang/lib/parser/token-parsers.h3
-rw-r--r--flang/lib/parser/token-sequence.cc2
-rw-r--r--flang/lib/parser/token-sequence.h3
-rw-r--r--flang/lib/parser/type-parsers.h3
-rw-r--r--flang/lib/parser/unparse.cc3
-rw-r--r--flang/lib/parser/unparse.h3
-rw-r--r--flang/lib/parser/user-state.cc3
-rw-r--r--flang/lib/parser/user-state.h3
-rw-r--r--flang/lib/semantics/attr.cc3
-rw-r--r--flang/lib/semantics/attr.h3
-rw-r--r--flang/lib/semantics/canonicalize-do.cc3
-rw-r--r--flang/lib/semantics/canonicalize-do.h2
-rw-r--r--flang/lib/semantics/check-do-concurrent.cc3
-rw-r--r--flang/lib/semantics/check-do-concurrent.h8
-rw-r--r--flang/lib/semantics/default-kinds.cc2
-rw-r--r--flang/lib/semantics/default-kinds.h3
-rw-r--r--flang/lib/semantics/dump-parse-tree.h2
-rw-r--r--flang/lib/semantics/expression.cc5
-rw-r--r--flang/lib/semantics/expression.h3
-rw-r--r--flang/lib/semantics/mod-file.cc19
-rw-r--r--flang/lib/semantics/mod-file.h3
-rw-r--r--flang/lib/semantics/resolve-labels.cc3
-rw-r--r--flang/lib/semantics/resolve-labels.h5
-rw-r--r--flang/lib/semantics/resolve-names.cc3
-rw-r--r--flang/lib/semantics/resolve-names.h5
-rw-r--r--flang/lib/semantics/rewrite-parse-tree.cc3
-rw-r--r--flang/lib/semantics/rewrite-parse-tree.h6
-rw-r--r--flang/lib/semantics/scope.cc3
-rw-r--r--flang/lib/semantics/scope.h3
-rw-r--r--flang/lib/semantics/semantics.cc3
-rw-r--r--flang/lib/semantics/semantics.h9
-rw-r--r--flang/lib/semantics/symbol.cc3
-rw-r--r--flang/lib/semantics/symbol.h3
-rw-r--r--flang/lib/semantics/type.cc3
-rw-r--r--flang/lib/semantics/type.h3
-rw-r--r--flang/lib/semantics/unparse-with-symbols.cc5
-rw-r--r--flang/lib/semantics/unparse-with-symbols.h4
-rw-r--r--flang/runtime/ISO_Fortran_binding.cc2
-rw-r--r--flang/runtime/derived-type.cc2
-rw-r--r--flang/runtime/derived-type.h2
-rw-r--r--flang/runtime/descriptor.cc2
-rw-r--r--flang/runtime/descriptor.h2
-rw-r--r--flang/runtime/transformational.cc3
-rw-r--r--flang/runtime/transformational.h3
-rw-r--r--flang/runtime/type-code.cc2
-rw-r--r--flang/runtime/type-code.h2
-rw-r--r--flang/test/evaluate/intrinsics.cc2
-rw-r--r--flang/test/evaluate/testing.cc4
-rw-r--r--flang/test/evaluate/testing.h2
-rw-r--r--flang/tools/f18/dump.cc2
120 files changed, 152 insertions, 238 deletions
diff --git a/flang/.clang-format b/flang/.clang-format
index f6221946d67a..eb459959d4d8 100644
--- a/flang/.clang-format
+++ b/flang/.clang-format
@@ -12,6 +12,7 @@ AlignTrailingComments: false
ConstructorInitializerIndentWidth: 2
SpaceAfterTemplateKeyword: false
SpacesBeforeTrailingComments: 2
+FixNamespaceComments: false
IncludeCategories:
- Regex: '^<'
Priority: 4
diff --git a/flang/include/flang/ISO_Fortran_binding.h b/flang/include/flang/ISO_Fortran_binding.h
index 0a1b479d3c1d..a391e1d216b1 100644
--- a/flang/include/flang/ISO_Fortran_binding.h
+++ b/flang/include/flang/ISO_Fortran_binding.h
@@ -99,7 +99,7 @@ typedef signed char CFI_type_t;
#define CFI_type_other (-1) // must be negative
/* Error code macros */
-#define CFI_SUCCESS 0 /* must be zero */
+#define CFI_SUCCESS 0 /* must be zero */
#define CFI_ERROR_BASE_ADDR_NULL 1
#define CFI_ERROR_BASE_ADDR_NOT_NULL 2
#define CFI_INVALID_ELEM_LEN 3
@@ -152,8 +152,8 @@ int CFI_setpointer(
#ifdef __cplusplus
} // extern "C"
} // inline namespace Fortran_2018
-} // namespace ISO
-} // namespace Fortran
+}
+}
#endif
#undef CFI_ISO_FORTRAN_BINDING_FLEXIBLE_ARRAY
diff --git a/flang/lib/common/bit-population-count.h b/flang/lib/common/bit-population-count.h
index ba00b1b3372d..9f5d237b4d2b 100644
--- a/flang/lib/common/bit-population-count.h
+++ b/flang/lib/common/bit-population-count.h
@@ -85,5 +85,5 @@ template<typename UINT> inline constexpr bool Parity(UINT x) {
template<typename UINT> inline constexpr int TrailingZeroCount(UINT x) {
return BitPopulationCount(x ^ (x - 1)) - !!x;
}
-} // namespace Fortran::common
+}
#endif // FORTRAN_COMMON_BIT_POPULATION_COUNT_H_
diff --git a/flang/lib/common/constexpr-bitset.h b/flang/lib/common/constexpr-bitset.h
index fca10d22a63a..802d32105fb7 100644
--- a/flang/lib/common/constexpr-bitset.h
+++ b/flang/lib/common/constexpr-bitset.h
@@ -149,5 +149,5 @@ public:
private:
Word bits_{0};
};
-} // namespace Fortran::common
+}
#endif // FORTRAN_COMMON_CONSTEXPR_BITSET_H_
diff --git a/flang/lib/common/enum-set.h b/flang/lib/common/enum-set.h
index b2c4d116e8ee..8c43403e30e2 100644
--- a/flang/lib/common/enum-set.h
+++ b/flang/lib/common/enum-set.h
@@ -198,7 +198,7 @@ public:
private:
bitsetType bitset_;
};
-} // namespace Fortran::common
+}
template<typename ENUM, std::size_t values>
struct std::hash<Fortran::common::EnumSet<ENUM, values>> {
diff --git a/flang/lib/common/fortran.h b/flang/lib/common/fortran.h
index db746775f713..1bc96798299f 100644
--- a/flang/lib/common/fortran.h
+++ b/flang/lib/common/fortran.h
@@ -33,6 +33,5 @@ ENUM_CLASS(ImportKind, Default, Only, None, All)
ENUM_CLASS(TypeParamAttr, Kind, Len)
ENUM_CLASS(RelationalOperator, LT, LE, EQ, NE, GE, GT)
-
-} // namespace Fortran::common
+}
#endif // FORTRAN_COMMON_FORTRAN_H_
diff --git a/flang/lib/common/idioms.cc b/flang/lib/common/idioms.cc
index 6027b1da26d4..db474d0037ff 100644
--- a/flang/lib/common/idioms.cc
+++ b/flang/lib/common/idioms.cc
@@ -46,4 +46,4 @@ std::string EnumIndexToString(int index, const char *enumNames) {
}
return std::string(p, q - p);
}
-} // namespace Fortran::common
+}
diff --git a/flang/lib/common/idioms.h b/flang/lib/common/idioms.h
index bb69bb54f488..a71a6c13196c 100644
--- a/flang/lib/common/idioms.h
+++ b/flang/lib/common/idioms.h
@@ -44,7 +44,7 @@ template<typename A>
struct is_trivially_copy_constructible<list<A>> : false_type {};
template<typename A>
struct is_trivially_copy_constructible<optional<list<A>>> : false_type {};
-} // namespace std
+}
#endif
// enable "this is a std::string"s with the 's' suffix
@@ -133,6 +133,5 @@ template<typename A> struct ListItemCount {
return Fortran::common::EnumIndexToString( \
static_cast<int>(e), #__VA_ARGS__); \
}
-
-} // namespace Fortran::common
+}
#endif // FORTRAN_COMMON_IDIOMS_H_
diff --git a/flang/lib/common/indirection.h b/flang/lib/common/indirection.h
index 6521748d2489..83901ae577af 100644
--- a/flang/lib/common/indirection.h
+++ b/flang/lib/common/indirection.h
@@ -152,6 +152,5 @@ public:
private:
A *p_{nullptr};
};
-
-} // namespace Fortran::common
+}
#endif // FORTRAN_COMMON_INDIRECTION_H_
diff --git a/flang/lib/common/interval.h b/flang/lib/common/interval.h
index caffcd720466..1a8550f3ccd3 100644
--- a/flang/lib/common/interval.h
+++ b/flang/lib/common/interval.h
@@ -107,6 +107,5 @@ private:
A start_;
std::size_t size_{0};
};
-
-} // namespace Fortran::common
+}
#endif // FORTRAN_COMMON_INTERVAL_H_
diff --git a/flang/lib/common/reference-counted.h b/flang/lib/common/reference-counted.h
index cf11684a767c..4f4b44ebacdd 100644
--- a/flang/lib/common/reference-counted.h
+++ b/flang/lib/common/reference-counted.h
@@ -78,6 +78,5 @@ private:
type *p_{nullptr};
};
-
-} // namespace Fortran::common
+}
#endif // FORTRAN_COMMON_REFERENCE_COUNTED_H_
diff --git a/flang/lib/common/template.h b/flang/lib/common/template.h
index 572c0b58b6ef..015eaedf505e 100644
--- a/flang/lib/common/template.h
+++ b/flang/lib/common/template.h
@@ -268,6 +268,5 @@ template<typename VISITOR>
typename VISITOR::Result SearchDynamicTypes(VISITOR &&visitor) {
return SearchDynamicTypesHelper<0, VISITOR>(std::move(visitor));
}
-
-} // namespace Fortran::common
+}
#endif // FORTRAN_COMMON_TEMPLATE_H_
diff --git a/flang/lib/evaluate/call.cc b/flang/lib/evaluate/call.cc
index bb233d8c9caa..120dd4b79cc2 100644
--- a/flang/lib/evaluate/call.cc
+++ b/flang/lib/evaluate/call.cc
@@ -42,5 +42,4 @@ std::optional<int> ActualArgument::VectorSize() const {
}
FOR_EACH_SPECIFIC_TYPE(template struct FunctionRef)
-
-} // namespace Fortran::evaluate
+}
diff --git a/flang/lib/evaluate/call.h b/flang/lib/evaluate/call.h
index 37978835524b..3aa8873fd854 100644
--- a/flang/lib/evaluate/call.h
+++ b/flang/lib/evaluate/call.h
@@ -47,6 +47,5 @@ struct ActualArgument {
};
using Arguments = std::vector<ActualArgument>;
-
-} // namespace Fortran::evaluate
+}
#endif // FORTRAN_EVALUATE_CALL_H_
diff --git a/flang/lib/evaluate/common.cc b/flang/lib/evaluate/common.cc
index c63daa082309..f9738a9ed0f9 100644
--- a/flang/lib/evaluate/common.cc
+++ b/flang/lib/evaluate/common.cc
@@ -33,5 +33,4 @@ void RealFlagWarnings(
context.messages.Say("underflow on %s"_en_US, operation);
}
}
-
-} // namespace Fortran::evaluate
+}
diff --git a/flang/lib/evaluate/common.h b/flang/lib/evaluate/common.h
index ffdbe98af68d..32890653c29a 100644
--- a/flang/lib/evaluate/common.h
+++ b/flang/lib/evaluate/common.h
@@ -164,6 +164,5 @@ struct FoldingContext {
};
void RealFlagWarnings(FoldingContext &, const RealFlags &, const char *op);
-
-} // namespace Fortran::evaluate
+}
#endif // FORTRAN_EVALUATE_COMMON_H_
diff --git a/flang/lib/evaluate/complex.cc b/flang/lib/evaluate/complex.cc
index 8a9cafc7b4a9..166551910d98 100644
--- a/flang/lib/evaluate/complex.cc
+++ b/flang/lib/evaluate/complex.cc
@@ -100,4 +100,4 @@ template class Complex<Real<Integer<32>, 24>>;
template class Complex<Real<Integer<64>, 53>>;
template class Complex<Real<Integer<80>, 64, false>>;
template class Complex<Real<Integer<128>, 112>>;
-} // namespace Fortran::evaluate::value
+}
diff --git a/flang/lib/evaluate/complex.h b/flang/lib/evaluate/complex.h
index ae6989d62b21..cc20b0373f26 100644
--- a/flang/lib/evaluate/complex.h
+++ b/flang/lib/evaluate/complex.h
@@ -95,6 +95,5 @@ extern template class Complex<Real<Integer<32>, 24>>;
extern template class Complex<Real<Integer<64>, 53>>;
extern template class Complex<Real<Integer<80>, 64, false>>;
extern template class Complex<Real<Integer<128>, 112>>;
-
-} // namespace Fortran::evaluate::value
+}
#endif // FORTRAN_EVALUATE_COMPLEX_H_
diff --git a/flang/lib/evaluate/expression.cc b/flang/lib/evaluate/expression.cc
index d59f2b289212..6fc1c185ec48 100644
--- a/flang/lib/evaluate/expression.cc
+++ b/flang/lib/evaluate/expression.cc
@@ -588,8 +588,7 @@ FOR_EACH_CHARACTER_KIND(template struct Relational)
template struct Relational<SomeType>;
FOR_EACH_INTRINSIC_KIND(template struct ExpressionBase)
FOR_EACH_CATEGORY_TYPE(template struct ExpressionBase)
-
-} // namespace Fortran::evaluate
+}
// For reclamation of analyzed expressions to which owning pointers have
// been embedded in the parse tree. This destructor appears here, where
@@ -601,4 +600,4 @@ template<> OwningPointer<evaluate::GenericExprWrapper>::~OwningPointer() {
p_ = nullptr;
}
template class OwningPointer<evaluate::GenericExprWrapper>;
-} // namespace Fortran::common
+}
diff --git a/flang/lib/evaluate/expression.h b/flang/lib/evaluate/expression.h
index a98000b9613b..9f7e62164ae4 100644
--- a/flang/lib/evaluate/expression.h
+++ b/flang/lib/evaluate/expression.h
@@ -711,6 +711,5 @@ template<> inline bool IsVariable(const Expr<SomeType> &expr) {
FOR_EACH_CATEGORY_TYPE(extern template class Expr)
FOR_EACH_TYPE_AND_KIND(extern template struct ExpressionBase)
-
-} // namespace Fortran::evaluate
+}
#endif // FORTRAN_EVALUATE_EXPRESSION_H_
diff --git a/flang/lib/evaluate/int-power.h b/flang/lib/evaluate/int-power.h
index 6f8a5748d6e0..87ee395f45ea 100644
--- a/flang/lib/evaluate/int-power.h
+++ b/flang/lib/evaluate/int-power.h
@@ -55,6 +55,5 @@ ValueWithRealFlags<REAL> IntPower(
}
return result;
}
-
-} // namespace Fortran::evaluate
+}
#endif // FORTRAN_EVALUATE_INT_POWER_H_
diff --git a/flang/lib/evaluate/integer.cc b/flang/lib/evaluate/integer.cc
index c560432949a8..735c75a03fe4 100644
--- a/flang/lib/evaluate/integer.cc
+++ b/flang/lib/evaluate/integer.cc
@@ -34,5 +34,4 @@ static_assert(Integer<64>::partBits == 32);
static_assert(std::is_same_v<typename Integer<64>::Part, std::uint32_t>);
static_assert(Integer<128>::partBits == 32);
static_assert(std::is_same_v<typename Integer<128>::Part, std::uint32_t>);
-
-} // namespace Fortran::evaluate::value
+}
diff --git a/flang/lib/evaluate/integer.h b/flang/lib/evaluate/integer.h
index 028335b48b73..6f0dfb6e55a7 100644
--- a/flang/lib/evaluate/integer.h
+++ b/flang/lib/evaluate/integer.h
@@ -1003,5 +1003,5 @@ extern template class Integer<32>;
extern template class Integer<64>;
extern template class Integer<80>;
extern template class Integer<128>;
-} // namespace Fortran::evaluate::value
+}
#endif // FORTRAN_EVALUATE_INTEGER_H_
diff --git a/flang/lib/evaluate/intrinsics.cc b/flang/lib/evaluate/intrinsics.cc
index 39a7c70462ff..a575f2771c7d 100644
--- a/flang/lib/evaluate/intrinsics.cc
+++ b/flang/lib/evaluate/intrinsics.cc
@@ -1275,5 +1275,4 @@ std::ostream &IntrinsicProcTable::Implementation::Dump(std::ostream &o) const {
std::ostream &IntrinsicProcTable::Dump(std::ostream &o) const {
return impl_->Dump(o);
}
-
-} // namespace Fortran::evaluate
+}
diff --git a/flang/lib/evaluate/intrinsics.h b/flang/lib/evaluate/intrinsics.h
index dea706b3004e..aea066cff127 100644
--- a/flang/lib/evaluate/intrinsics.h
+++ b/flang/lib/evaluate/intrinsics.h
@@ -68,5 +68,5 @@ public:
private:
Implementation *impl_{nullptr}; // owning pointer
};
-} // namespace Fortran::evaluate
+}
#endif // FORTRAN_EVALUATE_INTRINSICS_H_
diff --git a/flang/lib/evaluate/leading-zero-bit-count.h b/flang/lib/evaluate/leading-zero-bit-count.h
index 13749fb51827..33e990c9c69e 100644
--- a/flang/lib/evaluate/leading-zero-bit-count.h
+++ b/flang/lib/evaluate/leading-zero-bit-count.h
@@ -46,7 +46,7 @@ static constexpr std::uint8_t mapping[64]{63, 0, 58, 1, 59, 47, 53, 2, 60, 39,
48, 27, 54, 33, 42, 3, 61, 51, 37, 40, 49, 18, 28, 20, 55, 30, 34, 11, 43,
14, 22, 4, 62, 57, 46, 52, 38, 26, 32, 41, 50, 36, 17, 19, 29, 10, 13, 21,
56, 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5};
-} // namespace
+}
inline constexpr int LeadingZeroBitCount(std::uint64_t x) {
if (x == 0) {
@@ -89,10 +89,10 @@ static constexpr std::uint8_t eightBitLeadingZeroBitCount[256]{8, 7, 6, 6, 5, 5,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-} // namespace
+}
inline constexpr int LeadingZeroBitCount(std::uint8_t x) {
return eightBitLeadingZeroBitCount[x];
}
-} // namespace Fortran::evaluate
+}
#endif // FORTRAN_EVALUATE_LEADING_ZERO_BIT_COUNT_H_
diff --git a/flang/lib/evaluate/logical.cc b/flang/lib/evaluate/logical.cc
index da7f34b0b545..e67e7c5fb566 100644
--- a/flang/lib/evaluate/logical.cc
+++ b/flang/lib/evaluate/logical.cc
@@ -20,5 +20,4 @@ template class Logical<8>;
template class Logical<16>;
template class Logical<32>;
template class Logical<64>;
-
-} // namespace Fortran::evaluate::value
+}
diff --git a/flang/lib/evaluate/logical.h b/flang/lib/evaluate/logical.h
index cfab07fe9cb2..effd69a67123 100644
--- a/flang/lib/evaluate/logical.h
+++ b/flang/lib/evaluate/logical.h
@@ -57,5 +57,5 @@ extern template class Logical<8>;
extern template class Logical<16>;
extern template class Logical<32>;
extern template class Logical<64>;
-} // namespace Fortran::evaluate::value
+}
#endif // FORTRAN_EVALUATE_LOGICAL_H_
diff --git a/flang/lib/evaluate/real.cc b/flang/lib/evaluate/real.cc
index f70d6ccb3cae..9eef5312c897 100644
--- a/flang/lib/evaluate/real.cc
+++ b/flang/lib/evaluate/real.cc
@@ -486,4 +486,4 @@ template class Real<Integer<32>, 24>;
template class Real<Integer<64>, 53>;
template class Real<Integer<80>, 64, false>;
template class Real<Integer<128>, 112>;
-} // namespace Fortran::evaluate::value
+}
diff --git a/flang/lib/evaluate/real.h b/flang/lib/evaluate/real.h
index 90344625ed32..89fa4ef1b7f0 100644
--- a/flang/lib/evaluate/real.h
+++ b/flang/lib/evaluate/real.h
@@ -339,6 +339,5 @@ extern template class Real<Integer<64>, 53>;
extern template class Real<Integer<80>, 64, false>; // 80387 extended precision
extern template class Real<Integer<128>, 112>;
// N.B. No "double-double" support.
-
-} // namespace Fortran::evaluate::value
+}
#endif // FORTRAN_EVALUATE_REAL_H_
diff --git a/flang/lib/evaluate/rounding-bits.h b/flang/lib/evaluate/rounding-bits.h
index 1e27330209bf..27999372da83 100644
--- a/flang/lib/evaluate/rounding-bits.h
+++ b/flang/lib/evaluate/rounding-bits.h
@@ -100,5 +100,5 @@ private:
bool round_{false}; // 0.25 * ulp
bool sticky_{false}; // true if any lesser-valued bit would be set
};
-} // namespace Fortran::evaluate::value
+}
#endif // FORTRAN_EVALUATE_ROUNDING_BITS_H_
diff --git a/flang/lib/evaluate/tools.cc b/flang/lib/evaluate/tools.cc
index a15fc916d12a..d2c0160d14df 100644
--- a/flang/lib/evaluate/tools.cc
+++ b/flang/lib/evaluate/tools.cc
@@ -492,5 +492,4 @@ Expr<SomeLogical> BinaryLogicalOperation(
},
AsSameKindExprs(std::move(x), std::move(y)));
}
-
-} // namespace Fortran::evaluate
+}
diff --git a/flang/lib/evaluate/tools.h b/flang/lib/evaluate/tools.h
index 8b3b67a77ab9..a206e8a5358c 100644
--- a/flang/lib/evaluate/tools.h
+++ b/flang/lib/evaluate/tools.h
@@ -447,6 +447,5 @@ struct TypeKindVisitor {
int kind;
VALUE value;
};
-
-} // namespace Fortran::evaluate
+}
#endif // FORTRAN_EVALUATE_TOOLS_H_
diff --git a/flang/lib/evaluate/type.cc b/flang/lib/evaluate/type.cc
index f1ebebb40dd4..ebe5a03961ad 100644
--- a/flang/lib/evaluate/type.cc
+++ b/flang/lib/evaluate/type.cc
@@ -91,4 +91,4 @@ DynamicType DynamicType::ResultTypeForMultiply(const DynamicType &that) const {
std::string SomeDerived::Dump() const {
return "TYPE("s + spec().name().ToString() + ')';
}
-} // namespace Fortran::evaluate
+}
diff --git a/flang/lib/evaluate/type.h b/flang/lib/evaluate/type.h
index 142b5538dfd5..95ade4a2c255 100644
--- a/flang/lib/evaluate/type.h
+++ b/flang/lib/evaluate/type.h
@@ -38,7 +38,7 @@
namespace Fortran::semantics {
class DerivedTypeSpec;
class Symbol;
-} // namespace Fortran::semantics
+}
namespace Fortran::evaluate {
@@ -403,6 +403,5 @@ template<typename T> struct Constant {
std::ostream &Dump(std::ostream &) const;
Value value;
};
-
-} // namespace Fortran::evaluate
+}
#endif // FORTRAN_EVALUATE_TYPE_H_
diff --git a/flang/lib/evaluate/variable.cc b/flang/lib/evaluate/variable.cc
index a9c432ecbba1..727ba8b1e3f5 100644
--- a/flang/lib/evaluate/variable.cc
+++ b/flang/lib/evaluate/variable.cc
@@ -502,5 +502,4 @@ std::optional<DynamicType> ProcedureDesignator::GetType() const {
}
FOR_EACH_CHARACTER_KIND(template class Designator)
-
-} // namespace Fortran::evaluate
+}
diff --git a/flang/lib/evaluate/variable.h b/flang/lib/evaluate/variable.h
index 041ed2e27cf8..4bbbfef0b29c 100644
--- a/flang/lib/evaluate/variable.h
+++ b/flang/lib/evaluate/variable.h
@@ -380,6 +380,5 @@ private:
ProcedureDesignator proc_;
Arguments arguments_;
};
-
-} // namespace Fortran::evaluate
+}
#endif // FORTRAN_EVALUATE_VARIABLE_H_
diff --git a/flang/lib/parser/basic-parsers.h b/flang/lib/parser/basic-parsers.h
index 4c6015d505e0..c4891fc6636b 100644
--- a/flang/lib/parser/basic-parsers.h
+++ b/flang/lib/parser/basic-parsers.h
@@ -1356,6 +1356,5 @@ private:
template<typename PA> inline constexpr auto sourced(const PA &parser) {
return SourcedParser<PA>{parser};
}
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_BASIC_PARSERS_H_
diff --git a/flang/lib/parser/char-block.h b/flang/lib/parser/char-block.h
index c752703ea410..3fc0cd40e782 100644
--- a/flang/lib/parser/char-block.h
+++ b/flang/lib/parser/char-block.h
@@ -128,8 +128,7 @@ inline bool operator>=(const char *left, const CharBlock &right) {
inline bool operator>(const char *left, const CharBlock &right) {
return right < left;
}
-
-} // namespace Fortran::parser
+}
// Specializations to enable std::unordered_map<CharBlock, ...> &c.
template<> struct std::hash<Fortran::parser::CharBlock> {
diff --git a/flang/lib/parser/char-buffer.cc b/flang/lib/parser/char-buffer.cc
index 02074aa35a14..0fd97cf06b90 100644
--- a/flang/lib/parser/char-buffer.cc
+++ b/flang/lib/parser/char-buffer.cc
@@ -93,5 +93,4 @@ std::string CharBuffer::MarshalNormalized() const {
result.shrink_to_fit();
return result;
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/char-buffer.h b/flang/lib/parser/char-buffer.h
index 00dab906bb15..eb0fc1561645 100644
--- a/flang/lib/parser/char-buffer.h
+++ b/flang/lib/parser/char-buffer.h
@@ -79,6 +79,5 @@ private:
std::size_t bytes_{0};
bool lastBlockEmpty_{false};
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_CHAR_BUFFER_H_
diff --git a/flang/lib/parser/char-set.cc b/flang/lib/parser/char-set.cc
index f47dd7ba3c67..4b32da1b85e9 100644
--- a/flang/lib/parser/char-set.cc
+++ b/flang/lib/parser/char-set.cc
@@ -27,5 +27,4 @@ std::string SetOfChars::ToString() const {
}
return result;
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/char-set.h b/flang/lib/parser/char-set.h
index b5a8b39dfcfc..414c9aa73730 100644
--- a/flang/lib/parser/char-set.h
+++ b/flang/lib/parser/char-set.h
@@ -82,6 +82,5 @@ private:
constexpr SetOfChars(std::uint64_t b) : bits_{b} {}
std::uint64_t bits_{0};
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_CHAR_SET_H_
diff --git a/flang/lib/parser/characters.cc b/flang/lib/parser/characters.cc
index e25106412992..62cf95342b84 100644
--- a/flang/lib/parser/characters.cc
+++ b/flang/lib/parser/characters.cc
@@ -92,4 +92,4 @@ std::string QuoteCharacterLiteral(
result += '"';
return result;
}
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/characters.h b/flang/lib/parser/characters.h
index 9a088cf25177..ddf2a4747d51 100644
--- a/flang/lib/parser/characters.h
+++ b/flang/lib/parser/characters.h
@@ -168,6 +168,5 @@ std::optional<int> UTF8CharacterBytes(const char *);
std::optional<int> EUC_JPCharacterBytes(const char *);
std::optional<std::size_t> CountCharacters(
const char *, std::size_t bytes, std::optional<int> (*)(const char *));
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_CHARACTERS_H_
diff --git a/flang/lib/parser/debug-parser.cc b/flang/lib/parser/debug-parser.cc
index 60bd48b04c90..d6bac0e2b787 100644
--- a/flang/lib/parser/debug-parser.cc
+++ b/flang/lib/parser/debug-parser.cc
@@ -31,5 +31,4 @@ std::optional<Success> DebugParser::Parse(ParseState &state) const {
}
return {Success{}};
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/debug-parser.h b/flang/lib/parser/debug-parser.h
index 17643c390547..288be3bded6a 100644
--- a/flang/lib/parser/debug-parser.h
+++ b/flang/lib/parser/debug-parser.h
@@ -42,6 +42,5 @@ private:
constexpr DebugParser operator""_debug(const char str[], std::size_t n) {
return DebugParser{str, n};
}
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_DEBUG_PARSER_H_
diff --git a/flang/lib/parser/features.h b/flang/lib/parser/features.h
index 82cd2cd3a65a..7b8136d2f7ac 100644
--- a/flang/lib/parser/features.h
+++ b/flang/lib/parser/features.h
@@ -60,6 +60,5 @@ private:
LanguageFeatures warn_;
bool warnAll_{false};
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_FEATURES_H_
diff --git a/flang/lib/parser/format-specification.h b/flang/lib/parser/format-specification.h
index 9f1a02527e50..dbb4a749bdc6 100644
--- a/flang/lib/parser/format-specification.h
+++ b/flang/lib/parser/format-specification.h
@@ -143,6 +143,5 @@ struct FormatSpecification {
: items(std::move(is)), unlimitedItems(std::move(us)) {}
std::list<FormatItem> items, unlimitedItems;
};
-
-} // namespace Fortran::format
+}
#endif // FORTRAN_PARSER_FORMAT_SPECIFICATION_H_
diff --git a/flang/lib/parser/grammar.h b/flang/lib/parser/grammar.h
index b713dee986c4..8af8e153262a 100644
--- a/flang/lib/parser/grammar.h
+++ b/flang/lib/parser/grammar.h
@@ -3482,5 +3482,5 @@ TYPE_CONTEXT_PARSER("PAUSE statement"_en_US,
// is not used because parsing is not sensitive to rank
// R1030 default-char-constant-expr -> default-char-expr
// is only used via scalar-default-char-constant-expr
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_GRAMMAR_H_
diff --git a/flang/lib/parser/instrumented-parser.cc b/flang/lib/parser/instrumented-parser.cc
index 88b591b51cac..e7e0170db6ae 100644
--- a/flang/lib/parser/instrumented-parser.cc
+++ b/flang/lib/parser/instrumented-parser.cc
@@ -80,5 +80,4 @@ void ParsingLog::Dump(std::ostream &o, const CookedSource &cooked) const {
}
}
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/instrumented-parser.h b/flang/lib/parser/instrumented-parser.h
index aa29293300c0..9ded721aac6c 100644
--- a/flang/lib/parser/instrumented-parser.h
+++ b/flang/lib/parser/instrumented-parser.h
@@ -83,6 +83,5 @@ inline constexpr auto instrumented(
const MessageFixedText &tag, const PA &parser) {
return InstrumentedParser{tag, parser};
}
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_INSTRUMENTED_PARSER_H_
diff --git a/flang/lib/parser/message.cc b/flang/lib/parser/message.cc
index 7368242fd5c5..e50a25eb9421 100644
--- a/flang/lib/parser/message.cc
+++ b/flang/lib/parser/message.cc
@@ -301,5 +301,4 @@ ContextualMessages::SavedState ContextualMessages::SetLocation(
const CharBlock &at) {
return SavedState(*this, at);
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/message.h b/flang/lib/parser/message.h
index 3bed094e801e..67814d5d007e 100644
--- a/flang/lib/parser/message.h
+++ b/flang/lib/parser/message.h
@@ -63,7 +63,7 @@ constexpr MessageFixedText operator""_err_en_US(
const char str[], std::size_t n) {
return MessageFixedText{str, n, true /* fatal */};
}
-} // namespace literals
+}
class MessageFormattedText {
public:
@@ -274,5 +274,5 @@ private:
CharBlock at_;
Messages *messages_{nullptr};
};
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_MESSAGE_H_
diff --git a/flang/lib/parser/openmp-grammar.h b/flang/lib/parser/openmp-grammar.h
index e134f9efdaf3..1ec9d05faa73 100644
--- a/flang/lib/parser/openmp-grammar.h
+++ b/flang/lib/parser/openmp-grammar.h
@@ -585,6 +585,5 @@ TYPE_PARSER(skipStuffBeforeStatement >> "!$OMP "_sptok >> "END"_tok >>
TYPE_PARSER(construct<OpenMPLoopConstruct>(
Parser<OmpLoopDirective>{}, Parser<OmpClauseList>{} / endOmpLine))
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_OPENMP_GRAMMAR_H_
diff --git a/flang/lib/parser/parse-state.h b/flang/lib/parser/parse-state.h
index 9909f4660811..7c79c7d251cf 100644
--- a/flang/lib/parser/parse-state.h
+++ b/flang/lib/parser/parse-state.h
@@ -239,6 +239,5 @@ private:
// reflected in the copy and move constructors defined at the top of this
// class definition!
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_PARSE_STATE_H_
diff --git a/flang/lib/parser/parse-tree-visitor.h b/flang/lib/parser/parse-tree-visitor.h
index c5d319ba4311..664fbd92db58 100644
--- a/flang/lib/parser/parse-tree-visitor.h
+++ b/flang/lib/parser/parse-tree-visitor.h
@@ -757,6 +757,5 @@ void Walk(OpenMPDeclareTargetConstruct::WithExtendedList &x, M &mutator) {
mutator.Post(x);
}
}
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_PARSE_TREE_VISITOR_H_
diff --git a/flang/lib/parser/parse-tree.cc b/flang/lib/parser/parse-tree.cc
index 0a752293a71a..b2418a08a6b4 100644
--- a/flang/lib/parser/parse-tree.cc
+++ b/flang/lib/parser/parse-tree.cc
@@ -131,5 +131,4 @@ std::ostream &operator<<(std::ostream &os, const Name &x) {
std::ostream &operator<<(std::ostream &os, const CharBlock &x) {
return os << x.ToString();
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/parse-tree.h b/flang/lib/parser/parse-tree.h
index d0912ab5af1e..e04f19b67c5e 100644
--- a/flang/lib/parser/parse-tree.h
+++ b/flang/lib/parser/parse-tree.h
@@ -60,7 +60,7 @@ CLASS_TRAIT(TupleTrait)
// here.
namespace Fortran::semantics {
class Symbol;
-} // namespace Fortran::semantics
+}
// Expressions in the parse tree have owning pointers that can be set to
// type-checked generic expression representations by semantic analysis.
@@ -68,10 +68,10 @@ class Symbol;
// the bulk of lib/evaluate/*.h headers into the parser proper.
namespace Fortran::evaluate {
struct GenericExprWrapper; // forward definition, wraps Expr<SomeType>
-} // namespace Fortran::evaluate
+}
namespace Fortran::common {
extern template class OwningPointer<evaluate::GenericExprWrapper>;
-} // namespace Fortran::common
+}
// Most non-template classes in this file use these default definitions
// for their move constructor and move assignment operator=, and disable
@@ -3699,6 +3699,5 @@ struct OpenMPConstruct {
common::Indirection<OpenMPCriticalConstruct>, OmpSection>
u;
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_PARSE_TREE_H_
diff --git a/flang/lib/parser/parsing.cc b/flang/lib/parser/parsing.cc
index 16fc8211eb3d..b8fa4ccc1a93 100644
--- a/flang/lib/parser/parsing.cc
+++ b/flang/lib/parser/parsing.cc
@@ -136,5 +136,4 @@ bool Parsing::ForTesting(std::string path, std::ostream &err) {
}
return true;
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/parsing.h b/flang/lib/parser/parsing.h
index 911f5981920a..d48f8483f27a 100644
--- a/flang/lib/parser/parsing.h
+++ b/flang/lib/parser/parsing.h
@@ -82,6 +82,5 @@ private:
std::optional<Program> parseTree_;
ParsingLog log_;
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_PARSING_H_
diff --git a/flang/lib/parser/preprocessor.cc b/flang/lib/parser/preprocessor.cc
index 882d97498ecf..25ef71520e90 100644
--- a/flang/lib/parser/preprocessor.cc
+++ b/flang/lib/parser/preprocessor.cc
@@ -986,5 +986,4 @@ bool Preprocessor::IsIfPredicateTrue(const TokenSequence &expr,
}
return result;
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/preprocessor.h b/flang/lib/parser/preprocessor.h
index a8ce696a8fe7..595249050c5a 100644
--- a/flang/lib/parser/preprocessor.h
+++ b/flang/lib/parser/preprocessor.h
@@ -97,6 +97,5 @@ private:
std::unordered_map<CharBlock, Definition> definitions_;
std::stack<CanDeadElseAppear> ifStack_;
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_PREPROCESSOR_H_
diff --git a/flang/lib/parser/prescan.cc b/flang/lib/parser/prescan.cc
index 1fc80126592f..7e07b236d07a 100644
--- a/flang/lib/parser/prescan.cc
+++ b/flang/lib/parser/prescan.cc
@@ -973,5 +973,4 @@ void Prescanner::SourceFormChange(std::string &&dir) {
inFixedForm_ = true;
}
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/prescan.h b/flang/lib/parser/prescan.h
index 6fc6ea26b4e6..b11925feb178 100644
--- a/flang/lib/parser/prescan.h
+++ b/flang/lib/parser/prescan.h
@@ -211,6 +211,5 @@ private:
std::bitset<prime2> compilerDirectiveBloomFilter_; // 128 bytes
std::unordered_set<std::string> compilerDirectiveSentinels_;
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_PRESCAN_H_
diff --git a/flang/lib/parser/provenance.cc b/flang/lib/parser/provenance.cc
index 72eb28829f40..dae8a044b7ca 100644
--- a/flang/lib/parser/provenance.cc
+++ b/flang/lib/parser/provenance.cc
@@ -388,5 +388,4 @@ std::ostream &CookedSource::Dump(std::ostream &o) const {
provenanceMap_.Dump(o);
return o;
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/provenance.h b/flang/lib/parser/provenance.h
index 814ea61f91c8..f81e165ed45f 100644
--- a/flang/lib/parser/provenance.h
+++ b/flang/lib/parser/provenance.h
@@ -232,6 +232,5 @@ private:
std::string data_; // all of it, prescanned and preprocessed
OffsetToProvenanceMappings provenanceMap_;
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_PROVENANCE_H_
diff --git a/flang/lib/parser/source.cc b/flang/lib/parser/source.cc
index e1aaa2ed12da..d3772841ba53 100644
--- a/flang/lib/parser/source.cc
+++ b/flang/lib/parser/source.cc
@@ -249,5 +249,4 @@ std::pair<int, int> SourceFile::FindOffsetLineAndColumn(std::size_t at) const {
return {
static_cast<int>(low + 1), static_cast<int>(at - lineStart_[low] + 1)};
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/source.h b/flang/lib/parser/source.h
index 491969f71723..e3e0a33b3cc4 100644
--- a/flang/lib/parser/source.h
+++ b/flang/lib/parser/source.h
@@ -59,6 +59,5 @@ private:
std::vector<std::size_t> lineStart_;
std::string normalized_;
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_SOURCE_H_
diff --git a/flang/lib/parser/stmt-parser.h b/flang/lib/parser/stmt-parser.h
index 6e3d8d10d2ab..34a15067fdea 100644
--- a/flang/lib/parser/stmt-parser.h
+++ b/flang/lib/parser/stmt-parser.h
@@ -94,6 +94,5 @@ constexpr auto progUnitEndStmtErrorRecovery{
(many(!"END"_tok >> SkipPast<'\n'>{}) >>
("END"_tok >> SkipTo<'\n'>{} || consumedAllInput)) >>
missingOptionalName};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_STMT_PARSER_H_
diff --git a/flang/lib/parser/token-parsers.h b/flang/lib/parser/token-parsers.h
index ff407a33961f..c7affcabb37b 100644
--- a/flang/lib/parser/token-parsers.h
+++ b/flang/lib/parser/token-parsers.h
@@ -719,6 +719,5 @@ TYPE_PARSER(space >> "."_ch >>
construct<DefinedOpName>(
sourced(some(definedOpNameChar) >> construct<Name>())) /
"."_ch)
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_TOKEN_PARSERS_H_
diff --git a/flang/lib/parser/token-sequence.cc b/flang/lib/parser/token-sequence.cc
index 4c4b841d592f..619ae1d22679 100644
--- a/flang/lib/parser/token-sequence.cc
+++ b/flang/lib/parser/token-sequence.cc
@@ -258,4 +258,4 @@ ProvenanceRange TokenSequence::GetIntervalProvenanceRange(
ProvenanceRange TokenSequence::GetProvenanceRange() const {
return GetIntervalProvenanceRange(0, start_.size());
}
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/token-sequence.h b/flang/lib/parser/token-sequence.h
index 89ff52270022..0ba6a6ddc820 100644
--- a/flang/lib/parser/token-sequence.h
+++ b/flang/lib/parser/token-sequence.h
@@ -121,6 +121,5 @@ private:
std::vector<char> char_;
OffsetToProvenanceMappings provenances_;
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_TOKEN_SEQUENCE_H_
diff --git a/flang/lib/parser/type-parsers.h b/flang/lib/parser/type-parsers.h
index 85a42cf8bef9..f43ce99c2038 100644
--- a/flang/lib/parser/type-parsers.h
+++ b/flang/lib/parser/type-parsers.h
@@ -145,6 +145,5 @@ constexpr Parser<CompilerDirective> compilerDirective;
constexpr Parser<OpenMPConstruct> openmpConstruct;
constexpr Parser<OpenMPDeclarativeConstruct> openmpDeclarativeConstruct;
constexpr Parser<OpenMPEndLoopDirective> openmpEndLoopDirective;
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_TYPE_PARSERS_H_
diff --git a/flang/lib/parser/unparse.cc b/flang/lib/parser/unparse.cc
index ede1fc26dafa..6e91e95cbadd 100644
--- a/flang/lib/parser/unparse.cc
+++ b/flang/lib/parser/unparse.cc
@@ -2519,5 +2519,4 @@ void Unparse(std::ostream &out, const Program &program, Encoding encoding,
Walk(program, visitor);
visitor.Done();
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/unparse.h b/flang/lib/parser/unparse.h
index 11b2a0f6af7e..4031ec6d8bdd 100644
--- a/flang/lib/parser/unparse.h
+++ b/flang/lib/parser/unparse.h
@@ -32,7 +32,6 @@ using preStatementType =
void Unparse(std::ostream &out, const Program &program,
Encoding encoding = Encoding::UTF8, bool capitalizeKeywords = true,
bool backslashEscapes = true, preStatementType *preStatement = nullptr);
-
-} // namespace Fortran::parser
+}
#endif
diff --git a/flang/lib/parser/user-state.cc b/flang/lib/parser/user-state.cc
index 0c3f8bae77f9..a913a29368b2 100644
--- a/flang/lib/parser/user-state.cc
+++ b/flang/lib/parser/user-state.cc
@@ -96,5 +96,4 @@ std::optional<DataComponentDefStmt> StructureComponents::Parse(
}
return defs;
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/parser/user-state.h b/flang/lib/parser/user-state.h
index 3d4d38de0b73..539fbbd19b71 100644
--- a/flang/lib/parser/user-state.h
+++ b/flang/lib/parser/user-state.h
@@ -145,6 +145,5 @@ struct StructureComponents {
using resultType = DataComponentDefStmt;
static std::optional<DataComponentDefStmt> Parse(ParseState &);
};
-
-} // namespace Fortran::parser
+}
#endif // FORTRAN_PARSER_USER_STATE_H_
diff --git a/flang/lib/semantics/attr.cc b/flang/lib/semantics/attr.cc
index 3218bf4d4942..6cb90592648f 100644
--- a/flang/lib/semantics/attr.cc
+++ b/flang/lib/semantics/attr.cc
@@ -54,5 +54,4 @@ std::ostream &operator<<(std::ostream &o, const Attrs &attrs) {
}
return o;
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/attr.h b/flang/lib/semantics/attr.h
index 49fe998f819a..a2eb5b1be596 100644
--- a/flang/lib/semantics/attr.h
+++ b/flang/lib/semantics/attr.h
@@ -50,6 +50,5 @@ std::string AttrToString(Attr attr);
std::ostream &operator<<(std::ostream &o, Attr attr);
std::ostream &operator<<(std::ostream &o, const Attrs &attrs);
-
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_ATTR_H_
diff --git a/flang/lib/semantics/canonicalize-do.cc b/flang/lib/semantics/canonicalize-do.cc
index faa55ffc0650..843f0242a353 100644
--- a/flang/lib/semantics/canonicalize-do.cc
+++ b/flang/lib/semantics/canonicalize-do.cc
@@ -90,5 +90,4 @@ void CanonicalizeDo(Program &program) {
CanonicalizationOfDoLoops canonicalizationOfDoLoops;
Walk(program, canonicalizationOfDoLoops);
}
-
-} // namespace Fortran::parser
+}
diff --git a/flang/lib/semantics/canonicalize-do.h b/flang/lib/semantics/canonicalize-do.h
index 16a7b4a21866..7f4691001019 100644
--- a/flang/lib/semantics/canonicalize-do.h
+++ b/flang/lib/semantics/canonicalize-do.h
@@ -20,6 +20,6 @@
namespace Fortran::parser {
struct Program;
void CanonicalizeDo(Program &program);
-} // namespace Fortran::parser
+}
#endif // FORTRAN_SEMANTICS_CANONICALIZE_DO_H_
diff --git a/flang/lib/semantics/check-do-concurrent.cc b/flang/lib/semantics/check-do-concurrent.cc
index e94b965bdb2c..b7bbee3e662f 100644
--- a/flang/lib/semantics/check-do-concurrent.cc
+++ b/flang/lib/semantics/check-do-concurrent.cc
@@ -508,5 +508,4 @@ void CheckDoConcurrentConstraints(
FindDoConcurrentLoops findDoConcurrentLoops{messages};
Walk(program, findDoConcurrentLoops);
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/check-do-concurrent.h b/flang/lib/semantics/check-do-concurrent.h
index 1b5604ca84f2..6101762dadf2 100644
--- a/flang/lib/semantics/check-do-concurrent.h
+++ b/flang/lib/semantics/check-do-concurrent.h
@@ -18,11 +18,11 @@
namespace Fortran::parser {
class Messages;
struct Program;
-} // namespace Fortran::parser
+}
namespace Fortran::semantics {
-void CheckDoConcurrentConstraints(parser::Messages &messages, const parser::Program &program);
-
-} // namespace Fortran::semantics
+void CheckDoConcurrentConstraints(
+ parser::Messages &messages, const parser::Program &program);
+}
#endif // FORTRAN_SEMANTICS_CHECK_DO_CONCURRENT_H_
diff --git a/flang/lib/semantics/default-kinds.cc b/flang/lib/semantics/default-kinds.cc
index 0255b1918604..f9dfe3e96499 100644
--- a/flang/lib/semantics/default-kinds.cc
+++ b/flang/lib/semantics/default-kinds.cc
@@ -75,4 +75,4 @@ int IntrinsicTypeDefaultKinds::GetDefaultKind(TypeCategory category) const {
default: CRASH_NO_CASE; return 0;
}
}
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/default-kinds.h b/flang/lib/semantics/default-kinds.h
index 60c968b3ca72..d1f633966069 100644
--- a/flang/lib/semantics/default-kinds.h
+++ b/flang/lib/semantics/default-kinds.h
@@ -55,6 +55,5 @@ private:
int defaultCharacterKind_{1};
int defaultLogicalKind_{defaultIntegerKind_};
};
-
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_DEFAULT_KINDS_H_
diff --git a/flang/lib/semantics/dump-parse-tree.h b/flang/lib/semantics/dump-parse-tree.h
index 9c2e53dedd74..2a0c083927bd 100644
--- a/flang/lib/semantics/dump-parse-tree.h
+++ b/flang/lib/semantics/dump-parse-tree.h
@@ -828,5 +828,5 @@ template<typename T> void DumpTree(std::ostream &out, const T &x) {
ParseTreeDumper dumper{out};
parser::Walk(x, dumper);
}
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_DUMP_PARSE_TREE_H_
diff --git a/flang/lib/semantics/expression.cc b/flang/lib/semantics/expression.cc
index 48bc4bbeefb7..3126a3d80fa3 100644
--- a/flang/lib/semantics/expression.cc
+++ b/flang/lib/semantics/expression.cc
@@ -1186,8 +1186,7 @@ void ExprAnalyzer::CheckUnsubscriptedComponent(const Component &component) {
}
}
}
-
-} // namespace Fortran::evaluate
+}
namespace Fortran::semantics {
@@ -1225,4 +1224,4 @@ void AnalyzeExpressions(parser::Program &program, SemanticsContext &context) {
Mutator mutator{context};
parser::Walk(program, mutator);
}
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/expression.h b/flang/lib/semantics/expression.h
index a67f5484d217..b56c0c997bc9 100644
--- a/flang/lib/semantics/expression.h
+++ b/flang/lib/semantics/expression.h
@@ -34,6 +34,5 @@ std::optional<evaluate::Expr<evaluate::SomeType>> AnalyzeExpr(
// Semantic analysis of all expressions in a parse tree, which is
// decorated with typed representations for top-level expressions.
void AnalyzeExpressions(parser::Program &, SemanticsContext &);
-
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_EXPRESSION_H_
diff --git a/flang/lib/semantics/mod-file.cc b/flang/lib/semantics/mod-file.cc
index 359e07b09cb3..14a866688ac2 100644
--- a/flang/lib/semantics/mod-file.cc
+++ b/flang/lib/semantics/mod-file.cc
@@ -54,9 +54,7 @@ static bool FileContentsMatch(
static std::string GetHeader(const std::string &);
static std::size_t GetFileSize(const std::string &);
-void ModFileWriter::WriteAll() {
- WriteAll(context_.globalScope());
-}
+void ModFileWriter::WriteAll() { WriteAll(context_.globalScope()); }
void ModFileWriter::WriteAll(const Scope &scope) {
for (const auto &child : scope.children()) {
@@ -78,11 +76,12 @@ void ModFileWriter::WriteOne(const Scope &scope) {
void ModFileWriter::Write(const Symbol &symbol) {
auto *ancestor{symbol.get<ModuleDetails>().ancestor()};
auto ancestorName{ancestor ? ancestor->name().ToString() : ""s};
- auto path{ModFilePath(context_.moduleDirectory(), symbol.name(), ancestorName)};
+ auto path{
+ ModFilePath(context_.moduleDirectory(), symbol.name(), ancestorName)};
PutSymbols(*symbol.scope());
if (!WriteFile(path, GetAsString(symbol))) {
- context_.Say(symbol.name(), "Error writing %s: %s"_err_en_US,
- path.c_str(), std::strerror(errno));
+ context_.Say(symbol.name(), "Error writing %s: %s"_err_en_US, path.c_str(),
+ std::strerror(errno));
}
}
@@ -496,9 +495,8 @@ Scope *ModFileReader::Read(const SourceName &name, Scope *ancestor) {
auto &parseTree{parsing.parseTree()};
if (!parsing.messages().empty() || !parsing.consumedWholeFile() ||
!parseTree.has_value()) {
- context_.Say(name,
- "Module file for '%s' is corrupt: %s"_err_en_US, name.ToString().data(),
- path->data());
+ context_.Say(name, "Module file for '%s' is corrupt: %s"_err_en_US,
+ name.ToString().data(), path->data());
return nullptr;
}
Scope *parentScope; // the scope this module/submodule goes into
@@ -577,5 +575,4 @@ static std::string ModFilePath(const std::string &dir, const SourceName &name,
PutLower(path, name.ToString()) << extension;
return path.str();
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/mod-file.h b/flang/lib/semantics/mod-file.h
index 52dac7066551..73d72af1b4a9 100644
--- a/flang/lib/semantics/mod-file.h
+++ b/flang/lib/semantics/mod-file.h
@@ -75,7 +75,6 @@ private:
std::optional<std::string> FindModFile(
const SourceName &, const std::string &);
};
-
-} // namespace Fortran::semantics
+}
#endif
diff --git a/flang/lib/semantics/resolve-labels.cc b/flang/lib/semantics/resolve-labels.cc
index 043d3ccd9e95..9c1ba3f9ccc1 100644
--- a/flang/lib/semantics/resolve-labels.cc
+++ b/flang/lib/semantics/resolve-labels.cc
@@ -1129,5 +1129,4 @@ bool ValidateLabels(
parser::Messages &errorHandler, const parser::Program &program) {
return CheckConstraints(LabelAnalysis(errorHandler, program));
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/resolve-labels.h b/flang/lib/semantics/resolve-labels.h
index ad8fe6781d1b..746504697bd6 100644
--- a/flang/lib/semantics/resolve-labels.h
+++ b/flang/lib/semantics/resolve-labels.h
@@ -18,7 +18,7 @@
namespace Fortran::parser {
class Messages;
struct Program;
-} // namespace Fortran::parser
+}
namespace Fortran::semantics {
@@ -27,6 +27,5 @@ namespace Fortran::semantics {
/// \param program the parse tree of the program
/// \return true, iff the program's labels pass semantics checks
bool ValidateLabels(parser::Messages &messages, const parser::Program &program);
-
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_RESOLVE_LABELS_H_
diff --git a/flang/lib/semantics/resolve-names.cc b/flang/lib/semantics/resolve-names.cc
index 8327d42fec1e..88c8922fbb7e 100644
--- a/flang/lib/semantics/resolve-names.cc
+++ b/flang/lib/semantics/resolve-names.cc
@@ -3307,5 +3307,4 @@ static GenericSpec MapGenericSpec(const parser::GenericSpec &genericSpec) {
},
genericSpec.u);
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/resolve-names.h b/flang/lib/semantics/resolve-names.h
index c97c05a332de..8423029a3f1f 100644
--- a/flang/lib/semantics/resolve-names.h
+++ b/flang/lib/semantics/resolve-names.h
@@ -21,7 +21,7 @@
namespace Fortran::parser {
struct Program;
-} // namespace Fortran::parser
+}
namespace Fortran::semantics {
@@ -29,7 +29,6 @@ class SemanticsContext;
void ResolveNames(SemanticsContext &, const parser::Program &);
void DumpSymbols(std::ostream &);
-
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_RESOLVE_NAMES_H_
diff --git a/flang/lib/semantics/rewrite-parse-tree.cc b/flang/lib/semantics/rewrite-parse-tree.cc
index be29f5a8b1d6..74a3bcb11003 100644
--- a/flang/lib/semantics/rewrite-parse-tree.cc
+++ b/flang/lib/semantics/rewrite-parse-tree.cc
@@ -159,5 +159,4 @@ void RewriteParseTree(SemanticsContext &context, parser::Program &program) {
RewriteMutator mutator{context.messages(), symbols};
parser::Walk(program, mutator);
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/rewrite-parse-tree.h b/flang/lib/semantics/rewrite-parse-tree.h
index 7253601d4f69..9fb2affbb158 100644
--- a/flang/lib/semantics/rewrite-parse-tree.h
+++ b/flang/lib/semantics/rewrite-parse-tree.h
@@ -18,13 +18,13 @@
namespace Fortran::parser {
class Messages;
struct Program;
-} // namespace Fortran::parser
+}
namespace Fortran::semantics {
class SemanticsContext;
-} // namespace Fortran::semantics
+}
namespace Fortran::semantics {
void RewriteParseTree(SemanticsContext &, parser::Program &);
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_REWRITE_PARSE_TREE_H_
diff --git a/flang/lib/semantics/scope.cc b/flang/lib/semantics/scope.cc
index 49ddf9048ea0..2f583b22ebd4 100644
--- a/flang/lib/semantics/scope.cc
+++ b/flang/lib/semantics/scope.cc
@@ -146,5 +146,4 @@ std::ostream &operator<<(std::ostream &os, const Scope &scope) {
}
return os;
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/scope.h b/flang/lib/semantics/scope.h
index 756e8408a3b0..b60239dea07e 100644
--- a/flang/lib/semantics/scope.h
+++ b/flang/lib/semantics/scope.h
@@ -157,6 +157,5 @@ private:
friend std::ostream &operator<<(std::ostream &, const Scope &);
};
-
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_SCOPE_H_
diff --git a/flang/lib/semantics/semantics.cc b/flang/lib/semantics/semantics.cc
index 6e46ff102eaf..37070679941c 100644
--- a/flang/lib/semantics/semantics.cc
+++ b/flang/lib/semantics/semantics.cc
@@ -108,5 +108,4 @@ static void PutIndent(std::ostream &os, int indent) {
os << " ";
}
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/semantics.h b/flang/lib/semantics/semantics.h
index 17fdaab61709..f66c1f89ce69 100644
--- a/flang/lib/semantics/semantics.h
+++ b/flang/lib/semantics/semantics.h
@@ -16,8 +16,8 @@
#define FORTRAN_SEMANTICS_SEMANTICS_H_
#include "expression.h"
-#include "../evaluate/common.h"
#include "scope.h"
+#include "../evaluate/common.h"
#include "../evaluate/intrinsics.h"
#include "../parser/message.h"
#include <iosfwd>
@@ -27,7 +27,7 @@
namespace Fortran::parser {
struct Program;
class CookedSource;
-} // namespace Fortran::parser
+}
namespace Fortran::semantics {
@@ -49,7 +49,7 @@ public:
const evaluate::IntrinsicProcTable &intrinsics() const { return intrinsics_; }
Scope &globalScope() { return globalScope_; }
parser::Messages &messages() { return messages_; }
- evaluate::FoldingContext& foldingContext() { return foldingContext_; }
+ evaluate::FoldingContext &foldingContext() { return foldingContext_; }
SemanticsContext &set_searchDirectories(const std::vector<std::string> &x) {
searchDirectories_ = x;
@@ -102,7 +102,6 @@ private:
parser::Program &program_;
const parser::CookedSource &cooked_;
};
-
-} // namespace Fortran::semantics
+}
#endif
diff --git a/flang/lib/semantics/symbol.cc b/flang/lib/semantics/symbol.cc
index a29455fa73a7..740d100fdb30 100644
--- a/flang/lib/semantics/symbol.cc
+++ b/flang/lib/semantics/symbol.cc
@@ -485,5 +485,4 @@ std::ostream &DumpForUnparse(
}
return os;
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/symbol.h b/flang/lib/semantics/symbol.h
index d52f43bdb90f..7607e579a2c5 100644
--- a/flang/lib/semantics/symbol.h
+++ b/flang/lib/semantics/symbol.h
@@ -421,6 +421,5 @@ private:
return result;
}
};
-
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_SYMBOL_H_
diff --git a/flang/lib/semantics/type.cc b/flang/lib/semantics/type.cc
index 54e8fdc9d0a9..d134a5189d58 100644
--- a/flang/lib/semantics/type.cc
+++ b/flang/lib/semantics/type.cc
@@ -179,5 +179,4 @@ std::ostream &operator<<(std::ostream &o, const GenericSpec &x) {
default: CRASH_NO_CASE;
}
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/type.h b/flang/lib/semantics/type.h
index 600be9e5aca4..04a545e93711 100644
--- a/flang/lib/semantics/type.h
+++ b/flang/lib/semantics/type.h
@@ -269,7 +269,6 @@ private:
const Symbol *symbol_{nullptr};
std::optional<DeclTypeSpec> type_;
};
-
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_TYPE_H_
diff --git a/flang/lib/semantics/unparse-with-symbols.cc b/flang/lib/semantics/unparse-with-symbols.cc
index 843cb73cefe9..dc0c39eff57e 100644
--- a/flang/lib/semantics/unparse-with-symbols.cc
+++ b/flang/lib/semantics/unparse-with-symbols.cc
@@ -45,7 +45,7 @@ public:
private:
const SourceName *currStmt_{nullptr}; // current statement we are processing
- std::multimap<const char *, const Symbol*> symbols_; // location to symbol
+ std::multimap<const char *, const Symbol *> symbols_; // location to symbol
std::set<const Symbol *> symbolsDefined_; // symbols that have been processed
void Indent(std::ostream &, int) const;
};
@@ -89,5 +89,4 @@ void UnparseWithSymbols(std::ostream &out, const parser::Program &program,
}};
parser::Unparse(out, program, encoding, false, true, &preStatement);
}
-
-} // namespace Fortran::semantics
+}
diff --git a/flang/lib/semantics/unparse-with-symbols.h b/flang/lib/semantics/unparse-with-symbols.h
index 2984af921757..4d4d9d42b829 100644
--- a/flang/lib/semantics/unparse-with-symbols.h
+++ b/flang/lib/semantics/unparse-with-symbols.h
@@ -20,11 +20,11 @@
namespace Fortran::parser {
struct Program;
-} // namespace Fortran::parser
+}
namespace Fortran::semantics {
void UnparseWithSymbols(std::ostream &, const parser::Program &,
parser::Encoding encoding = parser::Encoding::UTF8);
-} // namespace Fortran::semantics
+}
#endif // FORTRAN_SEMANTICS_UNPARSE_WITH_SYMBOLS_H_
diff --git a/flang/runtime/ISO_Fortran_binding.cc b/flang/runtime/ISO_Fortran_binding.cc
index 0948785af33e..81a8f0c3d1f4 100644
--- a/flang/runtime/ISO_Fortran_binding.cc
+++ b/flang/runtime/ISO_Fortran_binding.cc
@@ -207,4 +207,4 @@ int CFI_setpointer(CFI_cdesc_t *result, const CFI_cdesc_t *source,
return CFI_INVALID_DESCRIPTOR; // TODO
}
} // extern "C"
-} // namespace Fortran::ISO
+}
diff --git a/flang/runtime/derived-type.cc b/flang/runtime/derived-type.cc
index 7ac03b6c109f..ba41f00ade8d 100644
--- a/flang/runtime/derived-type.cc
+++ b/flang/runtime/derived-type.cc
@@ -80,4 +80,4 @@ void DerivedType::Destroy(char *instance, bool finalize) const {
}
}
}
-} // namespace Fortran::runtime
+}
diff --git a/flang/runtime/derived-type.h b/flang/runtime/derived-type.h
index 09d173755a38..d778a5825e8f 100644
--- a/flang/runtime/derived-type.h
+++ b/flang/runtime/derived-type.h
@@ -192,5 +192,5 @@ private:
std::uint64_t flags_{0};
std::size_t bytes_{0};
};
-} // namespace Fortran::runtime
+}
#endif // FORTRAN_RUNTIME_DERIVED_TYPE_H_
diff --git a/flang/runtime/descriptor.cc b/flang/runtime/descriptor.cc
index 0281b413ea2c..87a92500c848 100644
--- a/flang/runtime/descriptor.cc
+++ b/flang/runtime/descriptor.cc
@@ -180,4 +180,4 @@ std::ostream &DescriptorAddendum::Dump(std::ostream &o) const {
// TODO: LEN parameter values
return o;
}
-} // namespace Fortran::runtime
+}
diff --git a/flang/runtime/descriptor.h b/flang/runtime/descriptor.h
index d1767cd1e44d..b0afaf077a19 100644
--- a/flang/runtime/descriptor.h
+++ b/flang/runtime/descriptor.h
@@ -329,5 +329,5 @@ public:
private:
char storage_[byteSize];
};
-} // namespace Fortran::runtime
+}
#endif // FORTRAN_RUNTIME_DESCRIPTOR_H_
diff --git a/flang/runtime/transformational.cc b/flang/runtime/transformational.cc
index 417599506592..98bd3c53e2b1 100644
--- a/flang/runtime/transformational.cc
+++ b/flang/runtime/transformational.cc
@@ -148,5 +148,4 @@ std::unique_ptr<Descriptor> RESHAPE(const Descriptor &source,
return result;
}
-
-} // namespace Fortran::runtime
+}
diff --git a/flang/runtime/transformational.h b/flang/runtime/transformational.h
index efd26375a896..9f2ce6763b2e 100644
--- a/flang/runtime/transformational.h
+++ b/flang/runtime/transformational.h
@@ -23,6 +23,5 @@ namespace Fortran::runtime {
std::unique_ptr<Descriptor> RESHAPE(const Descriptor &source,
const Descriptor &shape, const Descriptor *pad = nullptr,
const Descriptor *order = nullptr);
-
-} // namespace Fortran::runtime
+}
#endif // FORTRAN_RUNTIME_TRANSFORMATIONAL_H_
diff --git a/flang/runtime/type-code.cc b/flang/runtime/type-code.cc
index 15697cc115cf..72c45dd56c80 100644
--- a/flang/runtime/type-code.cc
+++ b/flang/runtime/type-code.cc
@@ -59,4 +59,4 @@ TypeCode::TypeCode(TypeCategory f, int kind) {
case TypeCategory::Derived: raw_ = CFI_type_struct; break;
}
}
-} // namespace Fortran::runtime
+}
diff --git a/flang/runtime/type-code.h b/flang/runtime/type-code.h
index d436da8e5d5a..21d488a54a21 100644
--- a/flang/runtime/type-code.h
+++ b/flang/runtime/type-code.h
@@ -71,5 +71,5 @@ public:
private:
ISO::CFI_type_t raw_{CFI_type_other};
};
-} // namespace Fortran::runtime
+}
#endif // FORTRAN_RUNTIME_TYPE_CODE_H_
diff --git a/flang/test/evaluate/intrinsics.cc b/flang/test/evaluate/intrinsics.cc
index 7f3e4ba8e98b..12a50fb8567c 100644
--- a/flang/test/evaluate/intrinsics.cc
+++ b/flang/test/evaluate/intrinsics.cc
@@ -206,7 +206,7 @@ void TestIntrinsics() {
TestCall{table, "abs"}.Push(Const(Scalar<Log4>{})).DoCall();
// TODO: test other intrinsics
}
-} // namespace Fortran::evaluate
+}
int main() {
Fortran::evaluate::TestIntrinsics();
diff --git a/flang/test/evaluate/testing.cc b/flang/test/evaluate/testing.cc
index 202db836ad86..e2c3398a73cb 100644
--- a/flang/test/evaluate/testing.cc
+++ b/flang/test/evaluate/testing.cc
@@ -23,7 +23,7 @@ namespace testing {
namespace {
int passes{0};
int failures{0};
-} // namespace
+}
static void BitBucket(const char *, ...) {}
@@ -133,4 +133,4 @@ int Complete() {
return EXIT_FAILURE;
}
}
-} // namespace testing
+}
diff --git a/flang/test/evaluate/testing.h b/flang/test/evaluate/testing.h
index 8e1679d899c7..e41c35002d98 100644
--- a/flang/test/evaluate/testing.h
+++ b/flang/test/evaluate/testing.h
@@ -44,5 +44,5 @@ FailureDetailPrinter Match(const char *file, int line, const char *want,
FailureDetailPrinter Compare(const char *file, int line, const char *xs,
const char *rel, const char *ys, unsigned long long x,
unsigned long long y);
-} // namespace testing
+}
#endif // FORTRAN_EVALUATE_TESTING_H_
diff --git a/flang/tools/f18/dump.cc b/flang/tools/f18/dump.cc
index 4b941bcee947..19684161d604 100644
--- a/flang/tools/f18/dump.cc
+++ b/flang/tools/f18/dump.cc
@@ -43,6 +43,6 @@ DEFINE_DUMP(semantics, Scope)
DEFINE_DUMP(semantics, IntrinsicTypeSpec)
DEFINE_DUMP(semantics, DerivedTypeSpec)
DEFINE_DUMP(semantics, DeclTypeSpec)
-} // namespace Fortran
+}
#endif