llvm/clang/utils/TableGen/ClangOptionDocEmitter.cpp

//===- ClangOptionDocEmitter.cpp - Documentation for command line flags ---===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// FIXME: Once this has stabilized, consider moving it to LLVM.
//
//===----------------------------------------------------------------------===//

#include "TableGenBackends.h"
#include "llvm/TableGen/Error.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
#include <cctype>
#include <cstring>
#include <map>

usingnamespacellvm;

namespace {
struct DocumentedOption {};
struct DocumentedGroup;
struct Documentation {};
struct DocumentedGroup : Documentation {};

static bool hasFlag(const Record *Option, StringRef OptionFlag,
                    StringRef FlagsField) {}

static bool isOptionVisible(const Record *Option, const Record *DocInfo) {}

// Reorganize the records into a suitable form for emitting documentation.
Documentation extractDocumentation(const RecordKeeper &Records,
                                   const Record *DocInfo) {}

// Get the first and successive separators to use for an OptionKind.
std::pair<StringRef,StringRef> getSeparatorsForKind(const Record *OptionKind) {}

const unsigned UnlimitedArgs =;

// Get the number of arguments expected for an option, or -1 if any number of
// arguments are accepted.
unsigned getNumArgsForKind(const Record *OptionKind, const Record *Option) {}

std::string escapeRST(StringRef Str) {}

StringRef getSphinxOptionID(StringRef OptionName) {}

bool canSphinxCopeWithOption(const Record *Option) {}

void emitHeading(int Depth, std::string Heading, raw_ostream &OS) {}

/// Get the value of field \p Primary, if possible. If \p Primary does not
/// exist, get the value of \p Fallback and escape it for rST emission.
std::string getRSTStringWithTextFallback(const Record *R, StringRef Primary,
                                         StringRef Fallback) {}

void emitOptionWithArgs(StringRef Prefix, const Record *Option,
                        ArrayRef<StringRef> Args, raw_ostream &OS) {}

constexpr StringLiteral DefaultMetaVarName =;

void emitOptionName(StringRef Prefix, const Record *Option, raw_ostream &OS) {}

bool emitOptionNames(const Record *Option, raw_ostream &OS, bool EmittedAny) {}

template <typename Fn>
void forEachOptionName(const DocumentedOption &Option, const Record *DocInfo,
                       Fn F) {}

void emitOption(const DocumentedOption &Option, const Record *DocInfo,
                raw_ostream &OS) {}

void emitDocumentation(int Depth, const Documentation &Doc,
                       const Record *DocInfo, raw_ostream &OS);

void emitGroup(int Depth, const DocumentedGroup &Group, const Record *DocInfo,
               raw_ostream &OS) {}

void emitDocumentation(int Depth, const Documentation &Doc,
                       const Record *DocInfo, raw_ostream &OS) {}

}  // namespace

void clang::EmitClangOptDocs(const RecordKeeper &Records, raw_ostream &OS) {}