You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2022/05/21 02:34:01 UTC
[tvm] branch main updated: [FFI] Renamed __VisitAttrs__ and __fvisit__ to non-reserved names (#11392)
This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new d0999bbd3b [FFI] Renamed __VisitAttrs__ and __fvisit__ to non-reserved names (#11392)
d0999bbd3b is described below
commit d0999bbd3b40b9466cc3b5c01f2b4b7fb09b478d
Author: Eric Lunderberg <Lu...@users.noreply.github.com>
AuthorDate: Fri May 20 21:33:55 2022 -0500
[FFI] Renamed __VisitAttrs__ and __fvisit__ to non-reserved names (#11392)
All names beginning with two underscores are reserved for the
compiler, even if they occur inside a class or namespace.
---
include/tvm/ir/attrs.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/tvm/ir/attrs.h b/include/tvm/ir/attrs.h
index 9a24687149..d2eda659a5 100644
--- a/include/tvm/ir/attrs.h
+++ b/include/tvm/ir/attrs.h
@@ -67,13 +67,13 @@ namespace tvm {
static constexpr const char* _type_key = TypeKey; \
TVM_DECLARE_FINAL_OBJECT_INFO(ClassName, ::tvm::BaseAttrsNode) \
template <typename FVisit> \
- void __VisitAttrs__(FVisit& __fvisit__) // NOLINT(*)
+ void _tvm_VisitAttrs(FVisit& _tvm_fvisit) // NOLINT(*)
/*!
* \brief Declare an attribute field.
* \param FieldName The field name.
*/
-#define TVM_ATTR_FIELD(FieldName) __fvisit__(#FieldName, &FieldName)
+#define TVM_ATTR_FIELD(FieldName) _tvm_fvisit(#FieldName, &FieldName)
/*!
* \brief Create a NodeRef type that represents null.
@@ -835,12 +835,12 @@ class AttrsNode : public BaseAttrsNode {
public:
void VisitAttrs(AttrVisitor* v) {
::tvm::detail::AttrNormalVisitor vis(v);
- self()->__VisitAttrs__(vis);
+ self()->_tvm_VisitAttrs(vis);
}
void VisitNonDefaultAttrs(AttrVisitor* v) {
::tvm::detail::AttrNonDefaultVisitor vis(v);
- self()->__VisitAttrs__(vis);
+ self()->_tvm_VisitAttrs(vis);
}
void InitByPackedArgs(const runtime::TVMArgs& args, bool allow_unknown) final {
@@ -861,7 +861,7 @@ class AttrsNode : public BaseAttrsNode {
return false;
};
auto vis = ::tvm::detail::CreateInitVisitor(DerivedType::_type_key, ffind);
- self()->__VisitAttrs__(vis);
+ self()->_tvm_VisitAttrs(vis);
hit_count = vis.hit_count_;
} else {
// construct a map then do lookup.
@@ -879,7 +879,7 @@ class AttrsNode : public BaseAttrsNode {
return false;
};
auto vis = ::tvm::detail::CreateInitVisitor(DerivedType::_type_key, ffind);
- self()->__VisitAttrs__(vis);
+ self()->_tvm_VisitAttrs(vis);
hit_count = vis.hit_count_;
}
// error handling, slow path
@@ -887,7 +887,7 @@ class AttrsNode : public BaseAttrsNode {
for (int i = 0; i < args.size(); i += 2) {
::tvm::detail::AttrExistVisitor visitor;
visitor.key_ = args[i].operator std::string();
- self()->__VisitAttrs__(visitor);
+ self()->_tvm_VisitAttrs(visitor);
if (!visitor.exist_) {
std::ostringstream os;
os << DerivedType::_type_key << ": does not have field \'" << visitor.key_
@@ -903,18 +903,18 @@ class AttrsNode : public BaseAttrsNode {
bool SEqualReduce(const DerivedType* other, SEqualReducer equal) const {
DerivedType* pself = self();
::tvm::detail::AttrsSEqualVisitor visitor(pself, other, equal);
- self()->__VisitAttrs__(visitor);
+ self()->_tvm_VisitAttrs(visitor);
return visitor.result_;
}
void SHashReduce(SHashReducer hash_reducer) const {
::tvm::detail::AttrsSHashVisitor visitor(hash_reducer);
- self()->__VisitAttrs__(visitor);
+ self()->_tvm_VisitAttrs(visitor);
}
Array<AttrFieldInfo> ListFieldInfo() const final {
::tvm::detail::AttrDocVisitor visitor;
- self()->__VisitAttrs__(visitor);
+ self()->_tvm_VisitAttrs(visitor);
return visitor.fields_;
}