clang 20.0.0git
|
The API notes manager helps find API notes associated with declarations. More...
#include "clang/APINotes/APINotesManager.h"
Public Member Functions | |
APINotesManager (SourceManager &SM, const LangOptions &LangOpts) | |
~APINotesManager () | |
void | setSwiftVersion (llvm::VersionTuple Version) |
Set the Swift version to use when filtering API notes. | |
bool | loadCurrentModuleAPINotes (Module *M, bool LookInModule, ArrayRef< std::string > SearchPaths) |
Load the API notes for the current module. | |
llvm::SmallVector< FileEntryRef, 2 > | getCurrentModuleAPINotes (Module *M, bool LookInModule, ArrayRef< std::string > SearchPaths) |
Get FileEntry for the APINotes of the module that is currently being compiled. | |
bool | loadCurrentModuleAPINotesFromBuffer (ArrayRef< StringRef > Buffers) |
Load Compiled API notes for current module. | |
ArrayRef< APINotesReader * > | getCurrentModuleReaders () const |
Retrieve the set of API notes readers for the current module. | |
llvm::SmallVector< APINotesReader *, 2 > | findAPINotes (SourceLocation Loc) |
Find the API notes readers that correspond to the given source location. | |
The API notes manager helps find API notes associated with declarations.
API notes are externally-provided annotations for declarations that can introduce new attributes (covering availability, nullability of parameters/results, and so on) for specific declarations without directly modifying the headers that contain those declarations.
The API notes manager is responsible for finding and loading the external API notes files that correspond to a given header. Its primary operation is findAPINotes()
, which finds the API notes reader that provides information about the declarations at that location.
Definition at line 44 of file APINotesManager.h.
APINotesManager::APINotesManager | ( | SourceManager & | SM, |
const LangOptions & | LangOpts | ||
) |
Definition at line 53 of file APINotesManager.cpp.
APINotesManager::~APINotesManager | ( | ) |
Definition at line 56 of file APINotesManager.cpp.
llvm::SmallVector< APINotesReader *, 2 > APINotesManager::findAPINotes | ( | SourceLocation | Loc | ) |
Find the API notes readers that correspond to the given source location.
Definition at line 332 of file APINotesManager.cpp.
References clang::File, getCurrentModuleReaders(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getFileEntryRefForID(), clang::SourceManager::getFileID(), clang::SourceManager::getFileManager(), clang::DirectoryEntryRef::getName(), clang::FileManager::getOptionalDirectoryRef(), clang::FileManager::getOptionalFileRef(), clang::SourceLocation::isInvalid(), Loc, Path, clang::api_notes::SOURCE_APINOTES_EXTENSION, and Visited.
Referenced by clang::Sema::ProcessAPINotes(), UnwindNamespaceContext(), and UnwindTagContext().
llvm::SmallVector< FileEntryRef, 2 > APINotesManager::getCurrentModuleAPINotes | ( | Module * | M, |
bool | LookInModule, | ||
ArrayRef< std::string > | SearchPaths | ||
) |
Get FileEntry for the APINotes of the module that is currently being compiled.
M | The current module. |
LookInModule | Whether to look inside the directory of the current module. |
SearchPaths | The paths in which we should search for API notes for the current module. |
Definition at line 221 of file APINotesManager.cpp.
References checkPrivateAPINotesName(), clang::Module::Directory, clang::Module::ExportAsModule, clang::File, clang::SourceManager::getDiagnostics(), clang::SourceManager::getFileManager(), clang::DirectoryEntryRef::getName(), clang::FileManager::getOptionalDirectoryRef(), clang::Module::getTopLevelModule(), clang::Module::getTopLevelModuleName(), hasPrivateSubmodules(), clang::Module::IsFramework, clang::Module::ModuleMapIsPrivate, and Path.
Referenced by loadCurrentModuleAPINotes().
|
inline |
Retrieve the set of API notes readers for the current module.
Definition at line 159 of file APINotesManager.h.
Referenced by findAPINotes(), and loadCurrentModuleAPINotes().
bool APINotesManager::loadCurrentModuleAPINotes | ( | Module * | M, |
bool | LookInModule, | ||
ArrayRef< std::string > | SearchPaths | ||
) |
Load the API notes for the current module.
M | The current module. |
LookInModule | Whether to look inside the module itself. |
SearchPaths | The paths in which we should search for API notes for the current module. |
false
otherwise. Definition at line 303 of file APINotesManager.cpp.
References clang::Module::APINotesFile, clang::File, getCurrentModuleAPINotes(), and getCurrentModuleReaders().
Load Compiled API notes for current module.
Buffers | Array of compiled API notes. |
false
otherwise. Definition at line 319 of file APINotesManager.cpp.
|
inline |
Set the Swift version to use when filtering API notes.
Definition at line 122 of file APINotesManager.h.