9#ifndef LLVM_CLANG_APINOTES_APINOTESMANAGER_H
10#define LLVM_CLANG_APINOTES_APINOTESMANAGER_H
13#include "llvm/ADT/ArrayRef.h"
14#include "llvm/ADT/DenseMap.h"
15#include "llvm/ADT/PointerUnion.h"
16#include "llvm/ADT/StringRef.h"
17#include "llvm/Support/VersionTuple.h"
45 using ReaderEntry = llvm::PointerUnion<DirectoryEntryRef, APINotesReader *>;
51 bool ImplicitAPINotes;
54 llvm::VersionTuple SwiftVersion;
56 enum ReaderKind :
unsigned { Public = 0, Private = 1 };
71 llvm::DenseMap<const DirectoryEntry *, ReaderEntry> Readers;
78 std::unique_ptr<APINotesReader> loadAPINotes(
FileEntryRef APINotesFile);
85 std::unique_ptr<APINotesReader> loadAPINotes(StringRef Buffer);
99 bool WantPublic =
true);
114 llvm::StringRef FrameworkName,
123 this->SwiftVersion = Version;
160 bool HasPublic = CurrentModuleReaders[ReaderKind::Public];
161 bool HasPrivate = CurrentModuleReaders[ReaderKind::Private];
162 assert((!HasPrivate || HasPublic) &&
"private module requires public module");
163 if (!HasPrivate && !HasPublic)
165 return ArrayRef(CurrentModuleReaders).slice(0, HasPrivate ? 2 : 1);
Defines the clang::SourceLocation class and associated facilities.
A reference to a DirectoryEntry that includes the name of the directory as it was accessed by the Fil...
Cached information about one directory (either on disk or in the virtual file system).
A reference to a FileEntry that includes the name of the file as it was accessed by the FileManager's...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Describes a module or submodule.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
The API notes manager helps find API notes associated with declarations.
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.
ArrayRef< APINotesReader * > getCurrentModuleReaders() const
Retrieve the set of API notes readers for the current module.
bool loadCurrentModuleAPINotesFromBuffer(ArrayRef< StringRef > Buffers)
Load Compiled API notes for current module.
void setSwiftVersion(llvm::VersionTuple Version)
Set the Swift version to use when filtering API notes.
llvm::SmallVector< APINotesReader *, 2 > findAPINotes(SourceLocation Loc)
Find the API notes readers that correspond to the given source location.
bool loadCurrentModuleAPINotes(Module *M, bool LookInModule, ArrayRef< std::string > SearchPaths)
Load the API notes for the current module.
A class that reads API notes data from a binary file that was written by the APINotesWriter.
The JSON file list parser is used to communicate input to InstallAPI.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...