brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · dd1dbbe Raw
46 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8//9// This file defines common utilities for generating documents from tablegen10// structures.11//12//===----------------------------------------------------------------------===//13 14#ifndef MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_15#define MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_16 17#include "llvm/ADT/StringRef.h"18 19namespace llvm {20class raw_ostream;21} // namespace llvm22 23namespace mlir {24namespace tblgen {25 26// Emit the summary. To avoid confusion, the summary is styled differently from27// the description.28void emitSummary(llvm::StringRef summary, llvm::raw_ostream &os);29 30// Emit the description by aligning the text to the left per line (e.g.31// removing the minimum indentation across the block).32//33// This expects that the description in the tablegen file is already formatted34// in a way the user wanted but has some additional indenting due to being35// nested.36void emitDescription(llvm::StringRef description, llvm::raw_ostream &os);37 38// Emit the description as a C++ comment while realigning it.39void emitDescriptionComment(llvm::StringRef description, llvm::raw_ostream &os,40                            llvm::StringRef prefix = "");41 42} // namespace tblgen43} // namespace mlir44 45#endif // MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_46