From: lixiaoquan Date: Thu, 22 Aug 2019 23:05:35 +0000 (+0800) Subject: [TVM] Fix warnings (#3817) X-Git-Tag: upstream/0.7.0~2009 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac474603c7664c59f59e4dfecac3d1603d6a4a67;p=platform%2Fupstream%2Ftvm.git [TVM] Fix warnings (#3817) transform.h:118:3: warning: 'const' type qualifier on return type has no effect attrs.h:68:3: note: expanded from macro 'TVM_DECLARE_ATTRS' node.h:244:3: note: expanded from macro 'TVM_DECLARE_NODE_TYPE_INFO' transform.h:95:3: warning: extra ';' after member function definition attrs.h:68:62: note: expanded from macro 'TVM_DECLARE_ATTRS' --- diff --git a/include/tvm/attrs.h b/include/tvm/attrs.h index 10fbe9f..3b64d1f 100644 --- a/include/tvm/attrs.h +++ b/include/tvm/attrs.h @@ -65,7 +65,7 @@ namespace tvm { */ #define TVM_DECLARE_ATTRS(ClassName, TypeKey) \ static constexpr const char* _type_key = TypeKey; \ - TVM_DECLARE_NODE_TYPE_INFO(ClassName, ::tvm::BaseAttrsNode); \ + TVM_DECLARE_NODE_TYPE_INFO(ClassName, ::tvm::BaseAttrsNode) \ template \ void __VisitAttrs__(FVisit& __fvisit__) // NOLINT(*) diff --git a/include/tvm/node/node.h b/include/tvm/node/node.h index 79187b8..e79b73d 100644 --- a/include/tvm/node/node.h +++ b/include/tvm/node/node.h @@ -91,7 +91,7 @@ class TVM_DLL Node : public NodeBase { */ virtual void VisitAttrs(AttrVisitor* visitor) {} /*! \return the type index of the node */ - virtual const uint32_t type_index() const = 0; + virtual uint32_t type_index() const = 0; /*! * \brief Whether this node derives from node with type_index=tid. * Implemented by TVM_DECLARE_NODE_TYPE_INFO @@ -99,7 +99,7 @@ class TVM_DLL Node : public NodeBase { * \param tid The type index. * \return the check result. */ - virtual const bool _DerivedFrom(uint32_t tid) const; + virtual bool _DerivedFrom(uint32_t tid) const; /*! * \brief get a runtime unique type index given a type key * \param type_key Type key of a type. @@ -228,7 +228,7 @@ inline SubRef Downcast(BaseRef ref); * \brief helper macro to declare type information in a base node. */ #define TVM_DECLARE_BASE_NODE_INFO(TypeName, Parent) \ - const bool _DerivedFrom(uint32_t tid) const override { \ + bool _DerivedFrom(uint32_t tid) const override { \ static uint32_t tidx = TypeKey2Index(TypeName::_type_key); \ if (tidx == tid) return true; \ return Parent::_DerivedFrom(tid); \ @@ -241,11 +241,11 @@ inline SubRef Downcast(BaseRef ref); const char* type_key() const final { \ return TypeName::_type_key; \ } \ - const uint32_t type_index() const final { \ + uint32_t type_index() const final { \ static uint32_t tidx = TypeKey2Index(TypeName::_type_key); \ return tidx; \ } \ - const bool _DerivedFrom(uint32_t tid) const final { \ + bool _DerivedFrom(uint32_t tid) const final { \ static uint32_t tidx = TypeKey2Index(TypeName::_type_key); \ if (tidx == tid) return true; \ return Parent::_DerivedFrom(tid); \ diff --git a/src/node/node.cc b/src/node/node.cc index 393f226..6b2f3c0 100644 --- a/src/node/node.cc +++ b/src/node/node.cc @@ -47,7 +47,7 @@ struct TypeManager { }; } // namespace -TVM_DLL const bool Node::_DerivedFrom(uint32_t tid) const { +TVM_DLL bool Node::_DerivedFrom(uint32_t tid) const { static uint32_t tindex = TypeKey2Index(Node::_type_key); return tid == tindex; }