18#ifndef LLVM_CLANG_EXTRACTAPI_API_H
19#define LLVM_CLANG_EXTRACTAPI_API_H
28#include "llvm/ADT/MapVector.h"
29#include "llvm/ADT/StringRef.h"
30#include "llvm/Support/Allocator.h"
31#include "llvm/Support/Casting.h"
32#include "llvm/TargetParser/Triple.h"
49 unsigned int Depth,
bool IsParameterPack)
50 :
Type(
Type), Name(Name), Index(Index), Depth(Depth),
51 IsParameterPack(IsParameterPack) {}
54 struct TemplateConstraint {
67 for (
auto *
const Parameter : *
Decl->getTemplateParameters()) {
68 const auto *Param = dyn_cast<TemplateTypeParmDecl>(
Parameter);
72 if (Param->hasTypeConstraint())
73 Type = Param->getTypeConstraint()->getNamedConcept()->getName().str();
74 else if (Param->wasDeclaredWithTypename())
80 Param->getDepth(), Param->isParameterPack());
85 for (
auto *
const Parameter : *
Decl->getTemplateParameters()) {
86 const auto *Param = dyn_cast<TemplateTypeParmDecl>(
Parameter);
90 if (Param->hasTypeConstraint())
91 Type = Param->getTypeConstraint()->getNamedConcept()->getName().str();
92 else if (Param->wasDeclaredWithTypename())
98 Param->getDepth(), Param->isParameterPack());
103 for (
auto *
const Parameter : *
Decl->getTemplateParameters()) {
104 const auto *Param = dyn_cast<TemplateTypeParmDecl>(
Parameter);
108 if (Param->hasTypeConstraint())
109 Type = Param->getTypeConstraint()->getNamedConcept()->getName().str();
110 else if (Param->wasDeclaredWithTypename())
116 Param->getDepth(), Param->isParameterPack());
129 unsigned int Index,
unsigned int Depth,
130 bool IsParameterPack) {
131 Parameters.emplace_back(
Type, Name, Index, Depth, IsParameterPack);
134 bool empty()
const {
return Parameters.empty() && Constraints.empty(); }
319 virtual void anchor();
384 virtual void anchor();
457 virtual void anchor();
473 return Record->getKind() ==
RK_Enum;
477 virtual void anchor();
495 virtual void anchor();
515 virtual void anchor();
546 virtual void anchor();
603 virtual void anchor();
621 virtual void anchor();
640 virtual void anchor();
660 virtual void anchor();
751 virtual void anchor();
773 virtual void anchor();
797 virtual void anchor();
834 virtual void anchor();
853 virtual void anchor();
939 virtual void anchor();
1028 virtual void anchor();
1053 virtual void anchor();
1072 virtual void anchor();
1090 virtual void anchor();
1116 virtual void anchor();
1123template <
typename RecordTy>
1131 :
public std::true_type {};
1143 :
public std::true_type {};
1145template <
typename RecordTy>
struct has_access :
public std::false_type {};
1153 :
public std::true_type {};
1162 :
public std::true_type {};
1164template <
typename RecordTy>
struct has_template :
public std::false_type {};
1168 :
public std::true_type {};
1174 :
public std::true_type {};
1184 :
public std::true_type {};
1187 :
public std::true_type {};
1198 bool IsFromSystemHeaderg);
1217 bool IsFromSystemHeader);
1245 bool IsFromSystemHeader);
1293 bool IsFromSystemHeader);
1322 bool IsFromSystemHeader);
1357 bool IsFromSystemHeader);
1364 bool IsFromSystemHeader);
1371 bool IsFromSystemHeader);
1378 bool IsFromSystemHeader);
1385 bool IsFromSystemHeader);
1392 bool IsFromSystemHeader);
1399 bool IsFromSystemHeader);
1412 bool IsFromSystemHeader,
bool IsFromExternalModule);
1425 bool IsFromSystemHeader);
1438 bool IsInstanceMethod,
bool IsFromSystemHeader);
1452 StringRef GetterName, StringRef SetterName,
bool IsOptional,
1453 bool IsInstanceProperty,
bool IsFromSystemHeader);
1466 bool IsFromSystemHeader);
1491 bool IsFromSystemHeader);
1506 template <
typename RecordTy,
1508 std::enable_if_t<std::is_base_of<APIRecord, RecordTy>::value>>
1509 using RecordMap = llvm::MapVector<StringRef, std::unique_ptr<RecordTy>>;
1519 return GlobalFunctions;
1521 const RecordMap<GlobalFunctionTemplateRecord> &
1523 return GlobalFunctionTemplates;
1525 const RecordMap<GlobalFunctionTemplateSpecializationRecord> &
1527 return GlobalFunctionTemplateSpecializations;
1530 return GlobalVariables;
1532 const RecordMap<GlobalVariableTemplateRecord> &
1534 return GlobalVariableTemplates;
1537 return StaticFields;
1539 const RecordMap<GlobalVariableTemplateSpecializationRecord> &
1541 return GlobalVariableTemplateSpecializations;
1543 const RecordMap<GlobalVariableTemplatePartialSpecializationRecord> &
1545 return GlobalVariableTemplatePartialSpecializations;
1551 return CXXMethodTemplates;
1554 return CXXInstanceMethods;
1557 return CXXStaticMethods;
1560 const RecordMap<CXXMethodTemplateSpecializationRecord> &
1562 return CXXMethodTemplateSpecializations;
1565 return CXXFieldTemplates;
1569 return ClassTemplates;
1571 const RecordMap<ClassTemplateSpecializationRecord> &
1573 return ClassTemplateSpecializations;
1575 const RecordMap<ClassTemplatePartialSpecializationRecord> &
1577 return ClassTemplatePartialSpecializations;
1581 return ObjCCategories;
1584 return ObjCInterfaces;
1587 return ObjCProtocols;
1625 llvm::BumpPtrAllocator StringAllocator;
1627 const llvm::Triple Target;
1630 llvm::DenseMap<StringRef, APIRecord *> USRBasedLookupTable;
1631 RecordMap<NamespaceRecord> Namespaces;
1632 RecordMap<GlobalFunctionRecord> GlobalFunctions;
1633 RecordMap<GlobalFunctionTemplateRecord> GlobalFunctionTemplates;
1634 RecordMap<GlobalFunctionTemplateSpecializationRecord>
1635 GlobalFunctionTemplateSpecializations;
1636 RecordMap<GlobalVariableRecord> GlobalVariables;
1637 RecordMap<GlobalVariableTemplateRecord> GlobalVariableTemplates;
1638 RecordMap<GlobalVariableTemplateSpecializationRecord>
1639 GlobalVariableTemplateSpecializations;
1640 RecordMap<GlobalVariableTemplatePartialSpecializationRecord>
1641 GlobalVariableTemplatePartialSpecializations;
1642 RecordMap<ConceptRecord> Concepts;
1643 RecordMap<StaticFieldRecord> StaticFields;
1644 RecordMap<EnumRecord> Enums;
1645 RecordMap<StructRecord> Structs;
1646 RecordMap<CXXClassRecord> CXXClasses;
1647 RecordMap<CXXFieldRecord> CXXFields;
1648 RecordMap<CXXMethodRecord> CXXMethods;
1649 RecordMap<CXXInstanceMethodRecord> CXXInstanceMethods;
1650 RecordMap<CXXStaticMethodRecord> CXXStaticMethods;
1651 RecordMap<CXXMethodTemplateRecord> CXXMethodTemplates;
1652 RecordMap<CXXMethodTemplateSpecializationRecord>
1653 CXXMethodTemplateSpecializations;
1654 RecordMap<CXXFieldTemplateRecord> CXXFieldTemplates;
1655 RecordMap<ClassTemplateRecord> ClassTemplates;
1656 RecordMap<ClassTemplateSpecializationRecord> ClassTemplateSpecializations;
1657 RecordMap<ClassTemplatePartialSpecializationRecord>
1658 ClassTemplatePartialSpecializations;
1659 RecordMap<ObjCCategoryRecord> ObjCCategories;
1660 RecordMap<ObjCInterfaceRecord> ObjCInterfaces;
1661 RecordMap<ObjCProtocolRecord> ObjCProtocols;
1662 RecordMap<MacroDefinitionRecord> Macros;
1663 RecordMap<TypedefRecord> Typedefs;
This file defines the AvailabilityInfo struct that collects availability attributes of a symbol.
This file defines the Declaration Fragments related classes.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
Decl - This represents one declaration (or definition), e.g.
Represents an unpacked "presumed" location which can be presented to the user.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
The base class of all kinds of template declarations (e.g., class, function, etc.).
The base class of the type hierarchy.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
Language
The language for the input, used to select and validate the language standard and possible actions.
@ Parameter
The parameter type of a method or function.
llvm::PointerUnion< TemplateTypeParmDecl *, NonTypeTemplateParmDecl *, TemplateTemplateParmDecl * > TemplateParameter
Stores a template parameter of any kind.
@ Interface
The "__interface" keyword introduces the elaborated-type-specifier.
@ Struct
The "struct" keyword introduces the elaborated-type-specifier.
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.