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;
58 bool VersionIndependentSwift;
61 llvm::VersionTuple SwiftVersion;
63 enum ReaderKind :
unsigned { Public = 0, Private = 1 };
78 llvm::DenseMap<const DirectoryEntry *, ReaderEntry> Readers;
85 std::unique_ptr<APINotesReader> loadAPINotes(
FileEntryRef APINotesFile);
92 std::unique_ptr<APINotesReader> loadAPINotes(StringRef Buffer);
106 bool WantPublic =
true);
121 llvm::StringRef FrameworkName,
130 this->SwiftVersion = Version;
167 bool HasPublic = CurrentModuleReaders[ReaderKind::Public];
168 bool HasPrivate = CurrentModuleReaders[ReaderKind::Private];
169 assert((!HasPrivate || HasPublic) &&
"private module requires public module");
170 if (!HasPrivate && !HasPublic)
172 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...
Cached information about one file (either on disk or in the virtual file system).
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.
APINotesManager(SourceManager &SM, const LangOptions &LangOpts)
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 captureVersionIndependentSwift()
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.
CustomizableOptional< FileEntryRef > OptionalFileEntryRef
CustomizableOptional< DirectoryEntryRef > OptionalDirectoryEntryRef