xref: /freebsd/contrib/llvm-project/clang/lib/AST/AttrDocTable.cpp (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1349cc55cSDimitry Andric //===--- AttrDocTable.cpp - implements Attr::getDocumentation() -*- C++ -*-===//
2349cc55cSDimitry Andric //
3349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6349cc55cSDimitry Andric //
7349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
8349cc55cSDimitry Andric //
9349cc55cSDimitry Andric //  This file contains out-of-line methods for Attr classes.
10349cc55cSDimitry Andric //
11349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
12349cc55cSDimitry Andric 
13349cc55cSDimitry Andric #include "clang/AST/Attr.h"
14349cc55cSDimitry Andric #include "llvm/ADT/StringRef.h"
15349cc55cSDimitry Andric 
16349cc55cSDimitry Andric #include "AttrDocTable.inc"
17349cc55cSDimitry Andric 
18349cc55cSDimitry Andric static const llvm::StringRef AttrDoc[] = {
19349cc55cSDimitry Andric #define ATTR(NAME) AttrDoc_##NAME,
20349cc55cSDimitry Andric #include "clang/Basic/AttrList.inc"
21349cc55cSDimitry Andric };
22349cc55cSDimitry Andric 
getDocumentation(clang::attr::Kind K)23349cc55cSDimitry Andric llvm::StringRef clang::Attr::getDocumentation(clang::attr::Kind K) {
24*0fca6ea1SDimitry Andric   if (K < (int)std::size(AttrDoc))
25349cc55cSDimitry Andric     return AttrDoc[K];
26349cc55cSDimitry Andric   return "";
27349cc55cSDimitry Andric }
28