[NFC] Add libcxx python reformat SHA to .git-blame-ignore-revs
[llvm-project.git] / mlir / tools / mlir-tblgen / DocGenUtilities.h
bloba1fbbb3c3e11efa0bc82f808c320ba10d4bfcfd4
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.
12 //===----------------------------------------------------------------------===//
14 #ifndef MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_
15 #define MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_
17 #include "llvm/ADT/StringRef.h"
19 namespace llvm {
20 class raw_ostream;
21 } // namespace llvm
23 namespace mlir {
24 namespace tblgen {
26 // Emit the description by aligning the text to the left per line (e.g.
27 // removing the minimum indentation across the block).
29 // This expects that the description in the tablegen file is already formatted
30 // in a way the user wanted but has some additional indenting due to being
31 // nested.
32 void emitDescription(llvm::StringRef description, llvm::raw_ostream &os);
34 // Emit the description as a C++ comment while realigning it.
35 void emitDescriptionComment(llvm::StringRef description, llvm::raw_ostream &os,
36 llvm::StringRef prefix = "");
38 } // namespace tblgen
39 } // namespace mlir
41 #endif // MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_