[flang-commits] [flang] 0e9e06a - [flang][NFC] Reformat files with current clang-format

peter klausler via flang-commits flang-commits at lists.llvm.org
Fri Aug 7 12:11:08 PDT 2020


Author: peter klausler
Date: 2020-08-07T12:10:26-07:00
New Revision: 0e9e06a6d4c5e0f267fffe7ec3e0c8e8b22ae46b

URL: https://github.com/llvm/llvm-project/commit/0e9e06a6d4c5e0f267fffe7ec3e0c8e8b22ae46b
DIFF: https://github.com/llvm/llvm-project/commit/0e9e06a6d4c5e0f267fffe7ec3e0c8e8b22ae46b.diff

LOG: [flang][NFC] Reformat files with current clang-format

Differential Revision: https://reviews.llvm.org/D85489

Added: 
    

Modified: 
    flang/include/flang/Common/indirection.h
    flang/include/flang/Common/template.h
    flang/include/flang/Evaluate/expression.h
    flang/include/flang/Evaluate/tools.h
    flang/include/flang/Evaluate/traverse.h
    flang/include/flang/Parser/message.h
    flang/include/flang/Parser/parse-state.h
    flang/include/flang/Parser/parse-tree.h
    flang/include/flang/Semantics/expression.h
    flang/include/flang/Semantics/semantics.h
    flang/lib/Evaluate/intrinsics-library-templates.h
    flang/lib/Parser/basic-parsers.h
    flang/lib/Parser/prescan.h
    flang/lib/Semantics/assignment.cpp
    flang/lib/Semantics/check-declarations.cpp
    flang/lib/Semantics/pointer-assignment.cpp
    flang/lib/Semantics/resolve-names.cpp
    flang/unittests/Evaluate/intrinsics.cpp
    flang/unittests/Runtime/external-io.cpp

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Common/indirection.h b/flang/include/flang/Common/indirection.h
index fec3bc7ae8da..a4ef615dc122 100644
--- a/flang/include/flang/Common/indirection.h
+++ b/flang/include/flang/Common/indirection.h
@@ -60,7 +60,7 @@ template <typename A, bool COPY = false> class Indirection {
   bool operator==(const Indirection &that) const { return *p_ == *that.p_; }
 
   template <typename... ARGS>
-  static common::IfNoLvalue<Indirection, ARGS...> Make(ARGS &&... args) {
+  static common::IfNoLvalue<Indirection, ARGS...> Make(ARGS &&...args) {
     return {new A(std::move(args)...)};
   }
 
@@ -112,7 +112,7 @@ template <typename A> class Indirection<A, true> {
   bool operator==(const Indirection &that) const { return *p_ == *that.p_; }
 
   template <typename... ARGS>
-  static common::IfNoLvalue<Indirection, ARGS...> Make(ARGS &&... args) {
+  static common::IfNoLvalue<Indirection, ARGS...> Make(ARGS &&...args) {
     return {new A(std::move(args)...)};
   }
 

diff  --git a/flang/include/flang/Common/template.h b/flang/include/flang/Common/template.h
index 866292cfcf48..f31b0afa97fb 100644
--- a/flang/include/flang/Common/template.h
+++ b/flang/include/flang/Common/template.h
@@ -135,7 +135,7 @@ common::IfNoLvalue<TOV, FROMV> MoveVariant(FROMV &&u) {
 //   CombineTuples<std::tuple<char, int>, std::tuple<float, double>>
 // is std::tuple<char, int, float, double>.
 template <typename... TUPLES> struct CombineTuplesHelper {
-  static decltype(auto) f(TUPLES *... a) {
+  static decltype(auto) f(TUPLES *...a) {
     return std::tuple_cat(std::move(*a)...);
   }
   using type = decltype(f(static_cast<TUPLES *>(nullptr)...));
@@ -265,7 +265,7 @@ std::optional<std::vector<A>> AllElementsPresent(
 // i.e., given some number of optional values, return a optional tuple of
 // those values that is present only of all of the values were so.
 template <typename... A>
-std::optional<std::tuple<A...>> AllPresent(std::optional<A> &&... x) {
+std::optional<std::tuple<A...>> AllPresent(std::optional<A> &&...x) {
   return AllElementsPresent(std::make_tuple(std::move(x)...));
 }
 
@@ -276,14 +276,14 @@ std::optional<std::tuple<A...>> AllPresent(std::optional<A> &&... x) {
 // run it through JoinOptional to "squash" it.
 template <typename R, typename... A>
 std::optional<R> MapOptional(
-    std::function<R(A &&...)> &&f, std::optional<A> &&... x) {
+    std::function<R(A &&...)> &&f, std::optional<A> &&...x) {
   if (auto args{AllPresent(std::move(x)...)}) {
     return std::make_optional(std::apply(std::move(f), std::move(*args)));
   }
   return std::nullopt;
 }
 template <typename R, typename... A>
-std::optional<R> MapOptional(R (*f)(A &&...), std::optional<A> &&... x) {
+std::optional<R> MapOptional(R (*f)(A &&...), std::optional<A> &&...x) {
   return MapOptional(std::function<R(A && ...)>{f}, std::move(x)...);
 }
 

diff  --git a/flang/include/flang/Evaluate/expression.h b/flang/include/flang/Evaluate/expression.h
index 3569b68fd9d2..3cb8dd688f76 100644
--- a/flang/include/flang/Evaluate/expression.h
+++ b/flang/include/flang/Evaluate/expression.h
@@ -129,8 +129,8 @@ class Operation {
 
 public:
   CLASS_BOILERPLATE(Operation)
-  explicit Operation(const Expr<OPERANDS> &... x) : operand_{x...} {}
-  explicit Operation(Expr<OPERANDS> &&... x) : operand_{std::move(x)...} {}
+  explicit Operation(const Expr<OPERANDS> &...x) : operand_{x...} {}
+  explicit Operation(Expr<OPERANDS> &&...x) : operand_{std::move(x)...} {}
 
   Derived &derived() { return *static_cast<Derived *>(this); }
   const Derived &derived() const { return *static_cast<const Derived *>(this); }

diff  --git a/flang/include/flang/Evaluate/tools.h b/flang/include/flang/Evaluate/tools.h
index e64aaece15bf..081795208b13 100644
--- a/flang/include/flang/Evaluate/tools.h
+++ b/flang/include/flang/Evaluate/tools.h
@@ -864,7 +864,7 @@ parser::Message *AttachDeclaration(parser::Message &, const Symbol &);
 parser::Message *AttachDeclaration(parser::Message *, const Symbol &);
 template <typename MESSAGES, typename... A>
 parser::Message *SayWithDeclaration(
-    MESSAGES &messages, const Symbol &symbol, A &&... x) {
+    MESSAGES &messages, const Symbol &symbol, A &&...x) {
   return AttachDeclaration(messages.Say(std::forward<A>(x)...), symbol);
 }
 

diff  --git a/flang/include/flang/Evaluate/traverse.h b/flang/include/flang/Evaluate/traverse.h
index 4888946c1a6c..a81f511d9dfa 100644
--- a/flang/include/flang/Evaluate/traverse.h
+++ b/flang/include/flang/Evaluate/traverse.h
@@ -241,7 +241,7 @@ template <typename Visitor, typename Result> class Traverse {
   }
 
   template <typename A, typename... Bs>
-  Result Combine(const A &x, const Bs &... ys) const {
+  Result Combine(const A &x, const Bs &...ys) const {
     if constexpr (sizeof...(Bs) == 0) {
       return visitor_(x);
     } else {

diff  --git a/flang/include/flang/Parser/message.h b/flang/include/flang/Parser/message.h
index 84106dbc3bfc..46a72e08a237 100644
--- a/flang/include/flang/Parser/message.h
+++ b/flang/include/flang/Parser/message.h
@@ -67,7 +67,7 @@ constexpr MessageFixedText operator""_err_en_US(
 class MessageFormattedText {
 public:
   template <typename... A>
-  MessageFormattedText(const MessageFixedText &text, A &&... x)
+  MessageFormattedText(const MessageFixedText &text, A &&...x)
       : isFatal_{text.isFatal()} {
     Format(&text, Convert(std::forward<A>(x))...);
   }
@@ -166,7 +166,7 @@ class Message : public common::ReferenceCounted<Message> {
       : location_{csr}, text_{t} {}
 
   template <typename RANGE, typename A, typename... As>
-  Message(RANGE r, const MessageFixedText &t, A &&x, As &&... xs)
+  Message(RANGE r, const MessageFixedText &t, A &&x, As &&...xs)
       : location_{r}, text_{MessageFormattedText{
                           t, std::forward<A>(x), std::forward<As>(xs)...}} {}
 
@@ -179,7 +179,7 @@ class Message : public common::ReferenceCounted<Message> {
   }
   Message &Attach(Message *);
   Message &Attach(std::unique_ptr<Message> &&);
-  template <typename... A> Message &Attach(A &&... args) {
+  template <typename... A> Message &Attach(A &&...args) {
     return Attach(new Message{std::forward<A>(args)...}); // reference-counted
   }
 
@@ -234,7 +234,7 @@ class Messages {
   bool empty() const { return messages_.empty(); }
   void clear();
 
-  template <typename... A> Message &Say(A &&... args) {
+  template <typename... A> Message &Say(A &&...args) {
     last_ = messages_.emplace_after(last_, std::forward<A>(args)...);
     return *last_;
   }
@@ -298,7 +298,7 @@ class ContextualMessages {
     return common::ScopedSet(messages_, nullptr);
   }
 
-  template <typename... A> Message *Say(CharBlock at, A &&... args) {
+  template <typename... A> Message *Say(CharBlock at, A &&...args) {
     if (messages_ != nullptr) {
       return &messages_->Say(at, std::forward<A>(args)...);
     } else {
@@ -306,7 +306,7 @@ class ContextualMessages {
     }
   }
 
-  template <typename... A> Message *Say(A &&... args) {
+  template <typename... A> Message *Say(A &&...args) {
     return Say(at_, std::forward<A>(args)...);
   }
 

diff  --git a/flang/include/flang/Parser/parse-state.h b/flang/include/flang/Parser/parse-state.h
index c704d6a9ad1b..5d96e95e4da7 100644
--- a/flang/include/flang/Parser/parse-state.h
+++ b/flang/include/flang/Parser/parse-state.h
@@ -131,19 +131,18 @@ class ParseState {
     context_ = context_->attachment();
   }
 
-  template <typename... A> void Say(CharBlock range, A &&... args) {
+  template <typename... A> void Say(CharBlock range, A &&...args) {
     if (deferMessages_) {
       anyDeferredMessages_ = true;
     } else {
       messages_.Say(range, std::forward<A>(args)...).SetContext(context_.get());
     }
   }
-  template <typename... A>
-  void Say(const MessageFixedText &text, A &&... args) {
+  template <typename... A> void Say(const MessageFixedText &text, A &&...args) {
     Say(p_, text, std::forward<A>(args)...);
   }
   template <typename... A>
-  void Say(const MessageExpectedText &text, A &&... args) {
+  void Say(const MessageExpectedText &text, A &&...args) {
     Say(p_, text, std::forward<A>(args)...);
   }
 

diff  --git a/flang/include/flang/Parser/parse-tree.h b/flang/include/flang/Parser/parse-tree.h
index c0a1a385801b..ebea3331ae5a 100644
--- a/flang/include/flang/Parser/parse-tree.h
+++ b/flang/include/flang/Parser/parse-tree.h
@@ -108,7 +108,7 @@ class ProcedureRef; // forward definition, represents a CALL statement
 // is conventionally named "t".
 #define TUPLE_CLASS_BOILERPLATE(classname) \
   template <typename... Ts, typename = common::NoLvalue<Ts...>> \
-  classname(Ts &&... args) : t(std::move(args)...) {} \
+  classname(Ts &&...args) : t(std::move(args)...) {} \
   using TupleTrait = std::true_type; \
   BOILERPLATE(classname)
 

diff  --git a/flang/include/flang/Semantics/expression.h b/flang/include/flang/Semantics/expression.h
index 4148a0d605d8..7daeeba507f6 100644
--- a/flang/include/flang/Semantics/expression.h
+++ b/flang/include/flang/Semantics/expression.h
@@ -115,12 +115,12 @@ class ExpressionAnalyzer {
     return foldingContext_.messages();
   }
 
-  template <typename... A> parser::Message *Say(A &&... args) {
+  template <typename... A> parser::Message *Say(A &&...args) {
     return GetContextualMessages().Say(std::forward<A>(args)...);
   }
 
   template <typename T, typename... A>
-  parser::Message *SayAt(const T &parsed, A &&... args) {
+  parser::Message *SayAt(const T &parsed, A &&...args) {
     return Say(parser::FindSourceLocation(parsed), std::forward<A>(args)...);
   }
 

diff  --git a/flang/include/flang/Semantics/semantics.h b/flang/include/flang/Semantics/semantics.h
index 0c60a98cd562..b6fdb35bdb08 100644
--- a/flang/include/flang/Semantics/semantics.h
+++ b/flang/include/flang/Semantics/semantics.h
@@ -133,12 +133,12 @@ class SemanticsContext {
   bool HasError(const parser::Name &);
   void SetError(Symbol &, bool = true);
 
-  template <typename... A> parser::Message &Say(A &&... args) {
+  template <typename... A> parser::Message &Say(A &&...args) {
     CHECK(location_);
     return messages_.Say(*location_, std::forward<A>(args)...);
   }
   template <typename... A>
-  parser::Message &Say(parser::CharBlock at, A &&... args) {
+  parser::Message &Say(parser::CharBlock at, A &&...args) {
     return messages_.Say(at, std::forward<A>(args)...);
   }
   parser::Message &Say(parser::Message &&msg) {
@@ -146,7 +146,7 @@ class SemanticsContext {
   }
   template <typename... A>
   void SayWithDecl(const Symbol &symbol, const parser::CharBlock &at,
-      parser::MessageFixedText &&msg, A &&... args) {
+      parser::MessageFixedText &&msg, A &&...args) {
     auto &message{Say(at, std::move(msg), args...)};
     evaluate::AttachDeclaration(&message, symbol);
   }

diff  --git a/flang/lib/Evaluate/intrinsics-library-templates.h b/flang/lib/Evaluate/intrinsics-library-templates.h
index 8accd2bbbd28..569e200b6b93 100644
--- a/flang/lib/Evaluate/intrinsics-library-templates.h
+++ b/flang/lib/Evaluate/intrinsics-library-templates.h
@@ -78,7 +78,7 @@ template <int Kind> struct Flusher<Type<TypeCategory::Complex, Kind>> {
 template <typename TR, typename... ArgInfo> struct CallableHostWrapper {
   static Scalar<TR> scalarCallable(FoldingContext &context,
       HostFuncPointer<TR, ArgInfo...> func,
-      const Scalar<typename ArgInfo::Type> &... x) {
+      const Scalar<typename ArgInfo::Type> &...x) {
     if constexpr (host::HostTypeExists<TR, typename ArgInfo::Type...>()) {
       host::HostFloatingPointEnvironment hostFPE;
       hostFPE.SetUpHostFloatingPointEnvironment(context);
@@ -192,7 +192,7 @@ HostIntrinsicProceduresLibrary::GetHostProcedureWrapper(
         if (match) {
           return {HostProcedureWrapper<ConstantContainer, TR, TA...>{
               [=](FoldingContext &context,
-                  const ConstantContainer<TA> &... args) {
+                  const ConstantContainer<TA> &...args) {
                 auto callable{FromGenericFunctionPointer<ConstantContainer<TR>,
                     FoldingContext &, GenericFunctionPointer,
                     const ConstantContainer<TA> &...>(iter->second.callable)};

diff  --git a/flang/lib/Parser/basic-parsers.h b/flang/lib/Parser/basic-parsers.h
index 6d88e5277fbe..300400517507 100644
--- a/flang/lib/Parser/basic-parsers.h
+++ b/flang/lib/Parser/basic-parsers.h
@@ -636,14 +636,14 @@ class ApplyFunction {
 
 template <typename RESULT, typename... PARSER>
 inline constexpr auto applyFunction(
-    ApplicableFunctionPointer<RESULT, PARSER...> f, const PARSER &... parser) {
+    ApplicableFunctionPointer<RESULT, PARSER...> f, const PARSER &...parser) {
   return ApplyFunction<ApplicableFunctionPointer, RESULT, PARSER...>{
       f, parser...};
 }
 
 template <typename RESULT, typename... PARSER>
 inline /* not constexpr */ auto applyLambda(
-    ApplicableFunctionObject<RESULT, PARSER...> f, const PARSER &... parser) {
+    ApplicableFunctionObject<RESULT, PARSER...> f, const PARSER &...parser) {
   return ApplyFunction<ApplicableFunctionObject, RESULT, PARSER...>{
       f, parser...};
 }

diff  --git a/flang/lib/Parser/prescan.h b/flang/lib/Parser/prescan.h
index 6e492a73597b..c4fdeae6e15e 100644
--- a/flang/lib/Parser/prescan.h
+++ b/flang/lib/Parser/prescan.h
@@ -64,7 +64,7 @@ class Prescanner {
   TokenSequence TokenizePreprocessorDirective();
   Provenance GetCurrentProvenance() const { return GetProvenance(at_); }
 
-  template <typename... A> Message &Say(A &&... a) {
+  template <typename... A> Message &Say(A &&...a) {
     Message &m{messages_.Say(std::forward<A>(a)...)};
     std::optional<ProvenanceRange> range{m.GetProvenanceRange(cooked_)};
     CHECK(!range || cooked_.IsValid(*range));

diff  --git a/flang/lib/Semantics/assignment.cpp b/flang/lib/Semantics/assignment.cpp
index ab8f5e4fdf56..0b765c72fdd7 100644
--- a/flang/lib/Semantics/assignment.cpp
+++ b/flang/lib/Semantics/assignment.cpp
@@ -47,7 +47,7 @@ class AssignmentContext {
       parser::CharBlock rhsSource, bool isPointerAssignment);
   void CheckShape(parser::CharBlock, const SomeExpr *);
   template <typename... A>
-  parser::Message *Say(parser::CharBlock at, A &&... args) {
+  parser::Message *Say(parser::CharBlock at, A &&...args) {
     return &context_.Say(at, std::forward<A>(args)...);
   }
   evaluate::FoldingContext &foldingContext() {

diff  --git a/flang/lib/Semantics/check-declarations.cpp b/flang/lib/Semantics/check-declarations.cpp
index a1f5be231fd9..4e91235938e6 100644
--- a/flang/lib/Semantics/check-declarations.cpp
+++ b/flang/lib/Semantics/check-declarations.cpp
@@ -86,7 +86,7 @@ class CheckHelper {
     return innermostSymbol_ && IsFunction(*innermostSymbol_);
   }
   template <typename... A>
-  void SayWithDeclaration(const Symbol &symbol, A &&... x) {
+  void SayWithDeclaration(const Symbol &symbol, A &&...x) {
     if (parser::Message * msg{messages_.Say(std::forward<A>(x)...)}) {
       if (messages_.at().begin() != symbol.name().begin()) {
         evaluate::AttachDeclaration(*msg, symbol);
@@ -1507,7 +1507,7 @@ bool SubprogramMatchHelper::CheckSameIntent(const Symbol &symbol1,
 // Report an error referring to first symbol with declaration of second symbol
 template <typename... A>
 void SubprogramMatchHelper::Say(const Symbol &symbol1, const Symbol &symbol2,
-    parser::MessageFixedText &&text, A &&... args) {
+    parser::MessageFixedText &&text, A &&...args) {
   auto &message{context.Say(symbol1.name(), std::move(text), symbol1.name(),
       std::forward<A>(args)...)};
   evaluate::AttachDeclaration(message, symbol2);

diff  --git a/flang/lib/Semantics/pointer-assignment.cpp b/flang/lib/Semantics/pointer-assignment.cpp
index 9adc998ec645..d97eedf37c12 100644
--- a/flang/lib/Semantics/pointer-assignment.cpp
+++ b/flang/lib/Semantics/pointer-assignment.cpp
@@ -345,7 +345,7 @@ bool PointerAssignmentChecker::LhsOkForUnlimitedPoly() const {
 }
 
 template <typename... A>
-parser::Message *PointerAssignmentChecker::Say(A &&... x) {
+parser::Message *PointerAssignmentChecker::Say(A &&...x) {
   auto *msg{context_.messages().Say(std::forward<A>(x)...)};
   if (lhs_) {
     return evaluate::AttachDeclaration(msg, *lhs_);

diff  --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index b245ef91deaa..ad93d01b2a1a 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -118,7 +118,7 @@ class MessageHandler {
   Message &Say(const SourceName &, MessageFixedText &&);
   // Emit a formatted message associated with a source location.
   template <typename... A>
-  Message &Say(const SourceName &source, MessageFixedText &&msg, A &&... args) {
+  Message &Say(const SourceName &source, MessageFixedText &&msg, A &&...args) {
     return context_->Say(source, std::move(msg), std::forward<A>(args)...);
   }
 
@@ -214,12 +214,12 @@ class BaseVisitor {
     }
   }
 
-  template <typename... A> Message &Say(A &&... args) {
+  template <typename... A> Message &Say(A &&...args) {
     return messageHandler_.Say(std::forward<A>(args)...);
   }
   template <typename... A>
   Message &Say(
-      const parser::Name &name, MessageFixedText &&text, const A &... args) {
+      const parser::Name &name, MessageFixedText &&text, const A &...args) {
     return messageHandler_.Say(name.source, std::move(text), args...);
   }
 

diff  --git a/flang/unittests/Evaluate/intrinsics.cpp b/flang/unittests/Evaluate/intrinsics.cpp
index 7b8895b8da4c..3b9805946286 100644
--- a/flang/unittests/Evaluate/intrinsics.cpp
+++ b/flang/unittests/Evaluate/intrinsics.cpp
@@ -69,7 +69,7 @@ struct TestCall {
     strings.Save(x.keyword);
     return *this;
   }
-  template <typename A, typename... As> TestCall &Push(A &&x, As &&... xs) {
+  template <typename A, typename... As> TestCall &Push(A &&x, As &&...xs) {
     Push(std::move(x));
     return Push(std::move(xs)...);
   }

diff  --git a/flang/unittests/Runtime/external-io.cpp b/flang/unittests/Runtime/external-io.cpp
index 6806ce94ae1e..c307f1ce9e0c 100644
--- a/flang/unittests/Runtime/external-io.cpp
+++ b/flang/unittests/Runtime/external-io.cpp
@@ -137,7 +137,7 @@ void TestSequentialFixedUnformatted() {
   //   FORM='UNFORMATTED',RECL=8,STATUS='SCRATCH')
   auto io{IONAME(BeginOpenNewUnit)(__FILE__, __LINE__)};
   IONAME(SetAccess)
-      (io, "SEQUENTIAL", 10) || (Fail() << "SetAccess(SEQUENTIAL)", 0);
+  (io, "SEQUENTIAL", 10) || (Fail() << "SetAccess(SEQUENTIAL)", 0);
   IONAME(SetAction)
   (io, "READWRITE", 9) || (Fail() << "SetAction(READWRITE)", 0);
   IONAME(SetForm)


        


More information about the flang-commits mailing list