//===- RegionGraphTraits.h - llvm::GraphTraits for CFGs ---------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements specializations of llvm::GraphTraits for various MLIR // CFG data types. This allows the generic LLVM graph algorithms to be applied // to CFGs. // //===----------------------------------------------------------------------===// #ifndef MLIR_IR_REGIONGRAPHTRAITS_H #define MLIR_IR_REGIONGRAPHTRAITS_H #include "mlir/IR/Region.h" #include "llvm/ADT/GraphTraits.h" namespace llvm { template <> struct GraphTraits<mlir::Block *> { … }; template <> struct GraphTraits<Inverse<mlir::Block *>> { … }; template <> struct GraphTraits<const mlir::Block *> { … }; template <> struct GraphTraits<Inverse<const mlir::Block *>> { … }; template <> struct GraphTraits<mlir::Region *> : public GraphTraits<mlir::Block *> { … }; template <> struct GraphTraits<Inverse<mlir::Region *>> : public GraphTraits<Inverse<mlir::Block *>> { … }; } // namespace llvm #endif