[llvm] [Support] Use block numbers for DomTree construction (PR #101706)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 07:25:36 PDT 2024


================
@@ -80,6 +81,16 @@ struct GraphTraits {
   using NodeRef = typename GraphType::UnknownGraphTypeError;
 };
 
+namespace detail {
+template <typename T>
+using has_number_t = decltype(GraphTraits<T>::getNumber(std::declval<T>()));
+} // namespace detail
+
+/// Indicate whether a GraphTraits<NodeT>::getNumber() is supported.
+template <typename NodeT>
+constexpr bool GraphHasNodeNumbers =
+    is_detected<detail::has_number_t, NodeT>::value;
----------------
kuhar wrote:

If this has a single user in the codebase, is it worth putting it in GraphTraits instead of GenericDomTreeConstruction?

https://github.com/llvm/llvm-project/pull/101706


More information about the llvm-commits mailing list