//===-- Generators.cpp - Generator Registry ----------------------*- C++-*-===// // // 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 // //===----------------------------------------------------------------------===// #include "Generators.h" LLVM_INSTANTIATE_REGISTRY(…) namespace clang { namespace doc { llvm::Expected<std::unique_ptr<Generator>> findGeneratorByName(llvm::StringRef Format) { … } // Enum conversion std::string getTagType(TagTypeKind AS) { … } llvm::Error Generator::createResources(ClangDocContext &CDCtx) { … } // A function to add a reference to Info in Idx. // Given an Info X with the following namespaces: [B,A]; a reference to X will // be added in the children of a reference to B, which should be also a child of // a reference to A, where A is a child of Idx. // Idx // |-- A // |--B // |--X // If the references to the namespaces do not exist, they will be created. If // the references already exist, the same one will be used. void Generator::addInfoToIndex(Index &Idx, const doc::Info *Info) { … } // This anchor is used to force the linker to link in the generated object file // and thus register the generators. extern volatile int YAMLGeneratorAnchorSource; extern volatile int MDGeneratorAnchorSource; extern volatile int HTMLGeneratorAnchorSource; static int LLVM_ATTRIBUTE_UNUSED YAMLGeneratorAnchorDest = …; static int LLVM_ATTRIBUTE_UNUSED MDGeneratorAnchorDest = …; static int LLVM_ATTRIBUTE_UNUSED HTMLGeneratorAnchorDest = …; } // namespace doc } // namespace clang