1 //===- DocGenUtilities.h - MLIR doc gen utilities ---------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines common utilities for generating documents from tablegen
12 //===----------------------------------------------------------------------===//
14 #ifndef MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_
15 #define MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_
17 #include "llvm/ADT/StringRef.h"
26 // Emit the summary. To avoid confusion, the summary is styled differently from
28 void emitSummary(llvm::StringRef summary
, llvm::raw_ostream
&os
);
30 // Emit the description by aligning the text to the left per line (e.g.
31 // removing the minimum indentation across the block).
33 // This expects that the description in the tablegen file is already formatted
34 // in a way the user wanted but has some additional indenting due to being
36 void emitDescription(llvm::StringRef description
, llvm::raw_ostream
&os
);
38 // Emit the description as a C++ comment while realigning it.
39 void emitDescriptionComment(llvm::StringRef description
, llvm::raw_ostream
&os
,
40 llvm::StringRef prefix
= "");
45 #endif // MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_