]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/onode-staged-tree: fix explicit template instantiation for clang 38645/head
authorYingxin Cheng <yingxin.cheng@intel.com>
Fri, 18 Dec 2020 02:55:43 +0000 (10:55 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Fri, 18 Dec 2020 02:55:43 +0000 (10:55 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/onode_manager/staged-fltree/stages/item_iterator_stage.cc
src/crimson/os/seastore/onode_manager/staged-fltree/stages/node_stage.cc
src/crimson/os/seastore/onode_manager/staged-fltree/stages/node_stage_layout.cc
src/crimson/os/seastore/onode_manager/staged-fltree/stages/sub_items_stage.cc

index 826de16631bdd7552db80c5d1938598aa4fd26bb..5a2b45577541ae5255c3623268b1220ca6253e63 100644 (file)
@@ -9,9 +9,6 @@ namespace crimson::os::seastore::onode {
 
 #define ITER_T item_iterator_t<NODE_TYPE>
 #define ITER_INST(NT) item_iterator_t<NT>
-#define ITER_TEMPLATE(NT) template class ITER_INST(NT)
-ITER_TEMPLATE(node_type_t::LEAF);
-ITER_TEMPLATE(node_type_t::INTERNAL);
 
 template <node_type_t NODE_TYPE>
 template <KeyT KT>
@@ -81,11 +78,11 @@ node_offset_t ITER_T::trim_at(
   return trim_size;
 }
 
+#define ITER_TEMPLATE(NT) template class ITER_INST(NT)
+ITER_TEMPLATE(node_type_t::LEAF);
+ITER_TEMPLATE(node_type_t::INTERNAL);
+
 #define APPEND_T ITER_T::Appender<KT>
-template class ITER_INST(node_type_t::LEAF)::Appender<KeyT::VIEW>;
-template class ITER_INST(node_type_t::INTERNAL)::Appender<KeyT::VIEW>;
-template class ITER_INST(node_type_t::LEAF)::Appender<KeyT::HOBJ>;
-template class ITER_INST(node_type_t::INTERNAL)::Appender<KeyT::HOBJ>;
 
 template <node_type_t NODE_TYPE>
 template <KeyT KT>
@@ -159,4 +156,10 @@ void APPEND_T::wrap_nxt(char* _p_append) {
   p_append = _p_append;
 }
 
+#define APPEND_TEMPLATE(NT, KT) template class ITER_INST(NT)::Appender<KT>
+APPEND_TEMPLATE(node_type_t::LEAF, KeyT::VIEW);
+APPEND_TEMPLATE(node_type_t::INTERNAL, KeyT::VIEW);
+APPEND_TEMPLATE(node_type_t::LEAF, KeyT::HOBJ);
+APPEND_TEMPLATE(node_type_t::INTERNAL, KeyT::HOBJ);
+
 }
index 4b7d3170f11770bfc918b3d27e1abd2a0b60dcca..d3b96048025cc3c83ad27a6219b332e1c4d3f04c 100644 (file)
@@ -10,15 +10,6 @@ namespace crimson::os::seastore::onode {
 
 #define NODE_T node_extent_t<FieldType, NODE_TYPE>
 #define NODE_INST(FT, NT) node_extent_t<FT, NT>
-#define NODE_TEMPLATE(FT, NT) template class NODE_INST(FT, NT)
-NODE_TEMPLATE(node_fields_0_t, node_type_t::INTERNAL);
-NODE_TEMPLATE(node_fields_1_t, node_type_t::INTERNAL);
-NODE_TEMPLATE(node_fields_2_t, node_type_t::INTERNAL);
-NODE_TEMPLATE(internal_fields_3_t, node_type_t::INTERNAL);
-NODE_TEMPLATE(node_fields_0_t, node_type_t::LEAF);
-NODE_TEMPLATE(node_fields_1_t, node_type_t::LEAF);
-NODE_TEMPLATE(node_fields_2_t, node_type_t::LEAF);
-NODE_TEMPLATE(leaf_fields_3_t, node_type_t::LEAF);
 
 template <typename FieldType, node_type_t NODE_TYPE>
 const char* NODE_T::p_left_bound() const {
@@ -176,24 +167,17 @@ node_offset_t NODE_T::trim_at(
   return 0;
 }
 
+#define NODE_TEMPLATE(FT, NT) template class NODE_INST(FT, NT)
+NODE_TEMPLATE(node_fields_0_t, node_type_t::INTERNAL);
+NODE_TEMPLATE(node_fields_1_t, node_type_t::INTERNAL);
+NODE_TEMPLATE(node_fields_2_t, node_type_t::INTERNAL);
+NODE_TEMPLATE(internal_fields_3_t, node_type_t::INTERNAL);
+NODE_TEMPLATE(node_fields_0_t, node_type_t::LEAF);
+NODE_TEMPLATE(node_fields_1_t, node_type_t::LEAF);
+NODE_TEMPLATE(node_fields_2_t, node_type_t::LEAF);
+NODE_TEMPLATE(leaf_fields_3_t, node_type_t::LEAF);
+
 #define APPEND_T node_extent_t<FieldType, NODE_TYPE>::Appender<KT>
-#define APPEND_TEMPLATE(FT, NT, KT) template class node_extent_t<FT, NT>::Appender<KT>
-APPEND_TEMPLATE(node_fields_0_t, node_type_t::INTERNAL, KeyT::VIEW);
-APPEND_TEMPLATE(node_fields_1_t, node_type_t::INTERNAL, KeyT::VIEW);
-APPEND_TEMPLATE(node_fields_2_t, node_type_t::INTERNAL, KeyT::VIEW);
-APPEND_TEMPLATE(internal_fields_3_t, node_type_t::INTERNAL, KeyT::VIEW);
-APPEND_TEMPLATE(node_fields_0_t, node_type_t::LEAF, KeyT::VIEW);
-APPEND_TEMPLATE(node_fields_1_t, node_type_t::LEAF, KeyT::VIEW);
-APPEND_TEMPLATE(node_fields_2_t, node_type_t::LEAF, KeyT::VIEW);
-APPEND_TEMPLATE(leaf_fields_3_t, node_type_t::LEAF, KeyT::VIEW);
-APPEND_TEMPLATE(node_fields_0_t, node_type_t::INTERNAL, KeyT::HOBJ);
-APPEND_TEMPLATE(node_fields_1_t, node_type_t::INTERNAL, KeyT::HOBJ);
-APPEND_TEMPLATE(node_fields_2_t, node_type_t::INTERNAL, KeyT::HOBJ);
-APPEND_TEMPLATE(internal_fields_3_t, node_type_t::INTERNAL, KeyT::HOBJ);
-APPEND_TEMPLATE(node_fields_0_t, node_type_t::LEAF, KeyT::HOBJ);
-APPEND_TEMPLATE(node_fields_1_t, node_type_t::LEAF, KeyT::HOBJ);
-APPEND_TEMPLATE(node_fields_2_t, node_type_t::LEAF, KeyT::HOBJ);
-APPEND_TEMPLATE(leaf_fields_3_t, node_type_t::LEAF, KeyT::HOBJ);
 
 template <typename FieldType, node_type_t NODE_TYPE>
 template <KeyT KT>
@@ -313,4 +297,22 @@ char* APPEND_T::wrap() {
   return p_append_left;
 }
 
+#define APPEND_TEMPLATE(FT, NT, KT) template class node_extent_t<FT, NT>::Appender<KT>
+APPEND_TEMPLATE(node_fields_0_t, node_type_t::INTERNAL, KeyT::VIEW);
+APPEND_TEMPLATE(node_fields_1_t, node_type_t::INTERNAL, KeyT::VIEW);
+APPEND_TEMPLATE(node_fields_2_t, node_type_t::INTERNAL, KeyT::VIEW);
+APPEND_TEMPLATE(internal_fields_3_t, node_type_t::INTERNAL, KeyT::VIEW);
+APPEND_TEMPLATE(node_fields_0_t, node_type_t::LEAF, KeyT::VIEW);
+APPEND_TEMPLATE(node_fields_1_t, node_type_t::LEAF, KeyT::VIEW);
+APPEND_TEMPLATE(node_fields_2_t, node_type_t::LEAF, KeyT::VIEW);
+APPEND_TEMPLATE(leaf_fields_3_t, node_type_t::LEAF, KeyT::VIEW);
+APPEND_TEMPLATE(node_fields_0_t, node_type_t::INTERNAL, KeyT::HOBJ);
+APPEND_TEMPLATE(node_fields_1_t, node_type_t::INTERNAL, KeyT::HOBJ);
+APPEND_TEMPLATE(node_fields_2_t, node_type_t::INTERNAL, KeyT::HOBJ);
+APPEND_TEMPLATE(internal_fields_3_t, node_type_t::INTERNAL, KeyT::HOBJ);
+APPEND_TEMPLATE(node_fields_0_t, node_type_t::LEAF, KeyT::HOBJ);
+APPEND_TEMPLATE(node_fields_1_t, node_type_t::LEAF, KeyT::HOBJ);
+APPEND_TEMPLATE(node_fields_2_t, node_type_t::LEAF, KeyT::HOBJ);
+APPEND_TEMPLATE(leaf_fields_3_t, node_type_t::LEAF, KeyT::HOBJ);
+
 }
index 2809803eb55f470594d535a5f9766987fac972c2..8f6b73a6a9c8f3585c4d633e98702921fd3b80f1 100644 (file)
@@ -28,10 +28,6 @@ void node_header_t::update_is_level_tail(
 
 #define F013_T _node_fields_013_t<SlotType>
 #define F013_INST(ST) _node_fields_013_t<ST>
-#define F013_TEMPLATE(ST) template struct F013_INST(ST)
-F013_TEMPLATE(slot_0_t);
-F013_TEMPLATE(slot_1_t);
-F013_TEMPLATE(slot_3_t);
 
 template <typename SlotType>
 void F013_T::update_size_at(
@@ -86,6 +82,11 @@ IA_TEMPLATE(slot_0_t, KeyT::HOBJ);
 IA_TEMPLATE(slot_1_t, KeyT::HOBJ);
 IA_TEMPLATE(slot_3_t, KeyT::HOBJ);
 
+#define F013_TEMPLATE(ST) template struct F013_INST(ST)
+F013_TEMPLATE(slot_0_t);
+F013_TEMPLATE(slot_1_t);
+F013_TEMPLATE(slot_3_t);
+
 void node_fields_2_t::append_offset(
     NodeExtentMutable& mut, node_offset_t offset_to_right, char*& p_append) {
   mut.copy_in_absolute(p_append, offset_to_right);
index bb3c64b97e3b98a0852297354469f63b832d1ef5..577b8b7bfc99299eacb81da8ba42f5484686e5ed 100644 (file)
@@ -38,9 +38,6 @@ node_offset_t internal_sub_items_t::trim_until(
   return ret;
 }
 
-template class internal_sub_items_t::Appender<KeyT::VIEW>;
-template class internal_sub_items_t::Appender<KeyT::HOBJ>;
-
 template <KeyT KT>
 void internal_sub_items_t::Appender<KT>::append(
     const internal_sub_items_t& src, size_t from, size_t items) {
@@ -135,14 +132,14 @@ node_offset_t leaf_sub_items_t::trim_until(
   return ret;
 }
 
+template class internal_sub_items_t::Appender<KeyT::VIEW>;
+template class internal_sub_items_t::Appender<KeyT::HOBJ>;
+
 // helper type for the visitor
 template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
 // explicit deduction guide
 template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
 
-template class leaf_sub_items_t::Appender<KeyT::VIEW>;
-template class leaf_sub_items_t::Appender<KeyT::HOBJ>;
-
 template <KeyT KT>
 char* leaf_sub_items_t::Appender<KT>::wrap() {
   auto p_cur = p_append;
@@ -202,4 +199,7 @@ char* leaf_sub_items_t::Appender<KT>::wrap() {
   return p_cur;
 }
 
+template class leaf_sub_items_t::Appender<KeyT::VIEW>;
+template class leaf_sub_items_t::Appender<KeyT::HOBJ>;
+
 }