[flang] check out with all versions
authorpeter klausler <pklausler@nvidia.com>
Mon, 4 Mar 2019 19:55:10 +0000 (11:55 -0800)
committerpeter klausler <pklausler@nvidia.com>
Mon, 4 Mar 2019 19:55:10 +0000 (11:55 -0800)
Original-commit: flang-compiler/f18@0b1369ce5511d728c10c1b00ca14a2c9c4572ac7
Reviewed-on: https://github.com/flang-compiler/f18/pull/313
Tree-same-pre-rewrite: false

flang/lib/common/indirection.h
flang/lib/evaluate/characteristics.cc
flang/lib/evaluate/characteristics.h
flang/lib/evaluate/expression.cc
flang/lib/evaluate/expression.h

index 620690c..ec8a788 100644 (file)
@@ -209,4 +209,12 @@ private:
   } \
   }
 }
+
+#define DEFINE_OWNING_POINTER_COPY_FUNCTIONS(A) \
+  DEFINE_OWNING_POINTER_COPY_CONSTRUCTORS(A) \
+  DEFINE_OWNING_POINTER_COPY_ASSIGNMENTS(A)
+#define DEFINE_OWNING_POINTER_SPECIAL_FUNCTIONS(A) \
+  DEFINE_OWNING_POINTER_DESTRUCTOR(A) \
+  DEFINE_OWNING_POINTER_COPY_FUNCTIONS(A)
+
 #endif  // FORTRAN_COMMON_INDIRECTION_H_
index c2dfa3b..088dd9c 100644 (file)
@@ -101,6 +101,4 @@ std::ostream &Procedure::Dump(std::ostream &o) const {
 }
 
 // Define OwningPointer special member functions
-DEFINE_OWNING_POINTER_DESTRUCTOR(evaluate::characteristics::Procedure)
-DEFINE_OWNING_POINTER_COPY_CONSTRUCTORS(evaluate::characteristics::Procedure)
-DEFINE_OWNING_POINTER_COPY_ASSIGNMENTS(evaluate::characteristics::Procedure)
+DEFINE_OWNING_POINTER_SPECIAL_FUNCTIONS(evaluate::characteristics::Procedure)
index e445247..d1389e1 100644 (file)
 #include <variant>
 #include <vector>
 
-// Forward declare Procedure so dummy procedures can use it indirectly
 namespace Fortran::evaluate::characteristics {
-struct Procedure;
-}
-namespace Fortran::common {
-extern template class OwningPointer<evaluate::characteristics::Procedure>;
-}
 
-namespace Fortran::evaluate::characteristics {
+// Forward declare Procedure so dummy procedures can use it indirectly
+struct Procedure;
 
 // 15.3.2.2
 struct DummyDataObject {
index 7f4cd1f..b48dc7f 100644 (file)
@@ -321,4 +321,4 @@ FOR_EACH_INTRINSIC_KIND(template class ArrayConstructor)
 // been embedded in the parse tree.  This destructor appears here, where
 // definitions for all the necessary types are available, to obviate a
 // need to include lib/evaluate/*.h headers in the parser proper.
-DEFINE_OWNING_POINTER_DESTRUCTOR(evaluate::GenericExprWrapper)
+DEFINE_OWNING_POINTER_SPECIAL_FUNCTIONS(evaluate::GenericExprWrapper)
index 235fde2..f011330 100644 (file)
@@ -762,7 +762,7 @@ public:
 };
 
 // This wrapper class is used, by means of a forward reference with
-// OwningPointer, to implement owning pointers to analyzed expressions
+// OwningPointer , to implement owning pointers to analyzed expressions
 // from parse tree nodes.
 struct GenericExprWrapper {
   GenericExprWrapper(Expr<SomeType> &&x) : v{std::move(x)} {}