clang 19.0.0git
FrontendRecords.h
Go to the documentation of this file.
1//===- InstallAPI/FrontendRecords.h ------------------------------*- 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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_INSTALLAPI_FRONTENDRECORDS_H
10#define LLVM_CLANG_INSTALLAPI_FRONTENDRECORDS_H
11
13#include "clang/AST/DeclObjC.h"
16
17namespace clang {
18namespace installapi {
19
20/// Frontend information captured about records.
23 const Decl *D;
26};
27
28// Represents a collection of frontend records for a library that are tied to a
29// darwin target triple.
31public:
32 FrontendRecordsSlice(const llvm::Triple &T)
33 : llvm::MachO::RecordsSlice({T}) {}
34
35 /// Add non-ObjC global record with attributes from AST.
36 ///
37 /// \param Name The name of symbol.
38 /// \param Linkage The linkage of symbol.
39 /// \param GV The kind of global.
40 /// \param Avail The availability information tied to the active target
41 /// triple.
42 /// \param D The pointer to the declaration from traversing AST.
43 /// \param Access The intended access level of symbol.
44 /// \param Flags The flags that describe attributes of the symbol.
45 /// \param Inlined Whether declaration is inlined, only applicable to
46 /// functions.
47 /// \return The non-owning pointer to added record in slice with it's frontend
48 /// attributes.
49 std::pair<GlobalRecord *, FrontendAttrs *>
50 addGlobal(StringRef Name, RecordLinkage Linkage, GlobalRecord::Kind GV,
51 const clang::AvailabilityInfo Avail, const Decl *D,
52 const HeaderType Access, SymbolFlags Flags = SymbolFlags::None,
53 bool Inlined = false);
54
55 /// Add ObjC Class record with attributes from AST.
56 ///
57 /// \param Name The name of class, not symbol.
58 /// \param Linkage The linkage of symbol.
59 /// \param Avail The availability information tied to the active target
60 /// triple.
61 /// \param D The pointer to the declaration from traversing AST.
62 /// \param Access The intended access level of symbol.
63 /// \param IsEHType Whether declaration has an exception attribute.
64 /// \return The non-owning pointer to added record in slice with it's frontend
65 /// attributes.
66 std::pair<ObjCInterfaceRecord *, FrontendAttrs *>
68 const clang::AvailabilityInfo Avail, const Decl *D,
69 HeaderType Access, bool IsEHType);
70
71 /// Add ObjC Category record with attributes from AST.
72 ///
73 /// \param ClassToExtend The name of class that is extended by category, not
74 /// symbol.
75 /// \param CategoryName The name of category, not symbol.
76 /// \param Avail The availability information tied
77 /// to the active target triple.
78 /// \param D The pointer to the declaration from traversing AST.
79 /// \param Access The intended access level of symbol.
80 /// \return The non-owning pointer to added record in slice with it's frontend
81 /// attributes.
82 std::pair<ObjCCategoryRecord *, FrontendAttrs *>
83 addObjCCategory(StringRef ClassToExtend, StringRef CategoryName,
84 const clang::AvailabilityInfo Avail, const Decl *D,
85 HeaderType Access);
86
87 /// Add ObjC IVar record with attributes from AST.
88 ///
89 /// \param Container The owning pointer for instance variable.
90 /// \param Name The name of ivar, not symbol.
91 /// \param Linkage The linkage of symbol.
92 /// \param Avail The availability information tied to the active target
93 /// triple.
94 /// \param D The pointer to the declaration from traversing AST.
95 /// \param Access The intended access level of symbol.
96 /// \param AC The access control tied to the ivar declaration.
97 /// \return The non-owning pointer to added record in slice with it's frontend
98 /// attributes.
99 std::pair<ObjCIVarRecord *, FrontendAttrs *>
100 addObjCIVar(ObjCContainerRecord *Container, StringRef IvarName,
102 const Decl *D, HeaderType Access,
104
105private:
106 /// Mapping of records stored in slice to their frontend attributes.
107 llvm::DenseMap<Record *, FrontendAttrs> FrontendRecords;
108};
109
110} // namespace installapi
111} // namespace clang
112
113#endif // LLVM_CLANG_INSTALLAPI_FRONTENDRECORDS_H
llvm::MachO::SymbolFlags SymbolFlags
Definition: MachO.h:29
llvm::MachO::RecordLinkage RecordLinkage
Definition: MachO.h:30
llvm::MachO::ObjCContainerRecord ObjCContainerRecord
Definition: MachO.h:34
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
Encodes a location in the source.
std::pair< ObjCIVarRecord *, FrontendAttrs * > addObjCIVar(ObjCContainerRecord *Container, StringRef IvarName, RecordLinkage Linkage, const clang::AvailabilityInfo Avail, const Decl *D, HeaderType Access, const clang::ObjCIvarDecl::AccessControl AC)
Add ObjC IVar record with attributes from AST.
Definition: Frontend.cpp:60
std::pair< GlobalRecord *, FrontendAttrs * > addGlobal(StringRef Name, RecordLinkage Linkage, GlobalRecord::Kind GV, const clang::AvailabilityInfo Avail, const Decl *D, const HeaderType Access, SymbolFlags Flags=SymbolFlags::None, bool Inlined=false)
Add non-ObjC global record with attributes from AST.
Definition: Frontend.cpp:19
std::pair< ObjCInterfaceRecord *, FrontendAttrs * > addObjCInterface(StringRef Name, RecordLinkage Linkage, const clang::AvailabilityInfo Avail, const Decl *D, HeaderType Access, bool IsEHType)
Add ObjC Class record with attributes from AST.
Definition: Frontend.cpp:32
std::pair< ObjCCategoryRecord *, FrontendAttrs * > addObjCCategory(StringRef ClassToExtend, StringRef CategoryName, const clang::AvailabilityInfo Avail, const Decl *D, HeaderType Access)
Add ObjC Category record with attributes from AST.
Definition: Frontend.cpp:49
FrontendRecordsSlice(const llvm::Triple &T)
The JSON file list parser is used to communicate input to InstallAPI.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
Definition: Linkage.h:24
const FunctionProtoType * T
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30
Storage of availability attributes for a declaration.
Definition: Availability.h:64
Frontend information captured about records.
const AvailabilityInfo Avail