1 //===- DocGenUtilities.h - MLIR doc gen utilities ---------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file defines common utilities for generating documents from tablegen 10 // structures. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_ 15 #define MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_ 16 17 namespace llvm { 18 class raw_ostream; 19 class StringRef; 20 } // namespace llvm 21 22 namespace mlir { 23 namespace tblgen { 24 25 // Emit the description by aligning the text to the left per line (e.g. 26 // removing the minimum indentation across the block). 27 // 28 // This expects that the description in the tablegen file is already formatted 29 // in a way the user wanted but has some additional indenting due to being 30 // nested. 31 void emitDescription(llvm::StringRef description, llvm::raw_ostream &os); 32 33 } // namespace tblgen 34 } // namespace mlir 35 36 #endif // MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_ 37