#include "clang/APINotes/APINotesManager.h"
#include "clang/APINotes/APINotesReader.h"
#include "clang/APINotes/APINotesYAMLCompiler.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/Module.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/SourceMgrAdapter.h"
#include "clang/Basic/Version.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/PrettyStackTrace.h"
usingnamespaceclang;
usingnamespaceapi_notes;
#define DEBUG_TYPE …
STATISTIC(NumHeaderAPINotes, "non-framework API notes files loaded");
STATISTIC(NumPublicFrameworkAPINotes, "framework public API notes loaded");
STATISTIC(NumPrivateFrameworkAPINotes, "framework private API notes loaded");
STATISTIC(NumFrameworksSearched, "frameworks searched");
STATISTIC(NumDirectoriesSearched, "header directories searched");
STATISTIC(NumDirectoryCacheHits, "directory cache hits");
namespace {
class PrettyStackTraceDoubleString : public llvm::PrettyStackTraceEntry { … };
}
APINotesManager::APINotesManager(SourceManager &SM, const LangOptions &LangOpts)
: … { … }
APINotesManager::~APINotesManager() { … }
std::unique_ptr<APINotesReader>
APINotesManager::loadAPINotes(FileEntryRef APINotesFile) { … }
std::unique_ptr<APINotesReader>
APINotesManager::loadAPINotes(StringRef Buffer) { … }
bool APINotesManager::loadAPINotes(const DirectoryEntry *HeaderDir,
FileEntryRef APINotesFile) { … }
OptionalFileEntryRef
APINotesManager::findAPINotesFile(DirectoryEntryRef Directory,
StringRef Basename, bool WantPublic) { … }
OptionalDirectoryEntryRef APINotesManager::loadFrameworkAPINotes(
llvm::StringRef FrameworkPath, llvm::StringRef FrameworkName, bool Public) { … }
static void checkPrivateAPINotesName(DiagnosticsEngine &Diags,
const FileEntry *File, const Module *M) { … }
static bool hasPrivateSubmodules(const Module *M) { … }
llvm::SmallVector<FileEntryRef, 2>
APINotesManager::getCurrentModuleAPINotes(Module *M, bool LookInModule,
ArrayRef<std::string> SearchPaths) { … }
bool APINotesManager::loadCurrentModuleAPINotes(
Module *M, bool LookInModule, ArrayRef<std::string> SearchPaths) { … }
bool APINotesManager::loadCurrentModuleAPINotesFromBuffer(
ArrayRef<StringRef> Buffers) { … }
llvm::SmallVector<APINotesReader *, 2>
APINotesManager::findAPINotes(SourceLocation Loc) { … }