diff --git a/include/llvm-dialects/Dialect/OpMap.h b/include/llvm-dialects/Dialect/OpMap.h index 543251d..1d18bfd 100644 --- a/include/llvm-dialects/Dialect/OpMap.h +++ b/include/llvm-dialects/Dialect/OpMap.h @@ -339,6 +339,10 @@ template class OpMap final { m_dialectOps.empty(); } + bool emptyCoreOpcodes() const { + return m_coreOpcodes.empty(); + } + // -------------------------------------------------------------------------- // Iterator definitions. // -------------------------------------------------------------------------- diff --git a/lib/Dialect/Visitor.cpp b/lib/Dialect/Visitor.cpp index 69e9e4f..9fbdd0d 100644 --- a/lib/Dialect/Visitor.cpp +++ b/lib/Dialect/Visitor.cpp @@ -185,8 +185,8 @@ VisitorBase::VisitorBase(VisitorTemplate &&templ) : m_strategy(templ.m_strategy), m_projections(std::move(templ.m_projections)) { if (m_strategy == VisitorStrategy::Default) { - m_strategy = templ.m_opMap.empty() ? VisitorStrategy::ByFunctionDeclaration - : VisitorStrategy::ByInstruction; + m_strategy = templ.m_opMap.emptyCoreOpcodes() ? VisitorStrategy::ByFunctionDeclaration + : VisitorStrategy::ByInstruction; } BuildHelper helper(*this, templ.m_handlers);