From 3e656599f1c1ab2d4b810ba054d59c99d5628b35 Mon Sep 17 00:00:00 2001 From: River Riddle Date: Thu, 21 Feb 2019 18:01:09 -0800 Subject: Define a PassID class to use when defining a pass. This allows for the type used for the ID field to be self documenting. It also allows for the compiler to know the set alignment of the ID object, which is useful for storing pointer identifiers within llvm data structures. PiperOrigin-RevId: 235107957 --- mlir/lib/Transforms/ViewFunctionGraph.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'mlir/lib/Transforms/ViewFunctionGraph.cpp') diff --git a/mlir/lib/Transforms/ViewFunctionGraph.cpp b/mlir/lib/Transforms/ViewFunctionGraph.cpp index 4865859b9ec..14e21770e25 100644 --- a/mlir/lib/Transforms/ViewFunctionGraph.cpp +++ b/mlir/lib/Transforms/ViewFunctionGraph.cpp @@ -83,7 +83,7 @@ struct PrintCFGPass : public FunctionPass { return success(); } - static char passID; + constexpr static PassID passID = {}; private: llvm::raw_ostream &os; @@ -92,8 +92,6 @@ private: }; } // namespace -char PrintCFGPass::passID = 0; - FunctionPass *mlir::createPrintCFGGraphPass(llvm::raw_ostream &os, bool shortNames, const llvm::Twine &title) { -- cgit v1.2.3