#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticFrontend.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Parse/Parser.h"
#include "clang/Sema/Lookup.h"
#include "clang/Serialization/ASTReader.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Threading.h"
#include "ClangHost.h"
#include "ClangModulesDeclVendor.h"
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/Progress.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/SourceModule.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include <memory>
usingnamespacelldb_private;
namespace {
class StoringDiagnosticConsumer : public clang::DiagnosticConsumer { … };
class ClangModulesDeclVendorImpl : public ClangModulesDeclVendor { … };
}
StoringDiagnosticConsumer::StoringDiagnosticConsumer() { … }
void StoringDiagnosticConsumer::HandleDiagnostic(
clang::DiagnosticsEngine::Level DiagLevel, const clang::Diagnostic &info) { … }
void StoringDiagnosticConsumer::ClearDiagnostics() { … }
void StoringDiagnosticConsumer::DumpDiagnostics(Stream &error_stream) { … }
void StoringDiagnosticConsumer::BeginSourceFile(
const clang::LangOptions &LangOpts, const clang::Preprocessor *PP) { … }
void StoringDiagnosticConsumer::EndSourceFile() { … }
bool StoringDiagnosticConsumer::HandleModuleRemark(
const clang::Diagnostic &info) { … }
void StoringDiagnosticConsumer::SetCurrentModuleProgress(
std::string module_name) { … }
ClangModulesDeclVendor::ClangModulesDeclVendor()
: … { … }
ClangModulesDeclVendor::~ClangModulesDeclVendor() = default;
ClangModulesDeclVendorImpl::ClangModulesDeclVendorImpl(
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> diagnostics_engine,
std::shared_ptr<clang::CompilerInvocation> compiler_invocation,
std::unique_ptr<clang::CompilerInstance> compiler_instance,
std::unique_ptr<clang::Parser> parser)
: … { … }
void ClangModulesDeclVendorImpl::ReportModuleExportsHelper(
ExportedModuleSet &exports, clang::Module *module) { … }
void ClangModulesDeclVendorImpl::ReportModuleExports(
ClangModulesDeclVendor::ModuleVector &exports, clang::Module *module) { … }
bool ClangModulesDeclVendorImpl::AddModule(const SourceModule &module,
ModuleVector *exported_modules,
Stream &error_stream) { … }
bool ClangModulesDeclVendor::LanguageSupportsClangModules(
lldb::LanguageType language) { … }
bool ClangModulesDeclVendorImpl::AddModulesForCompileUnit(
CompileUnit &cu, ClangModulesDeclVendor::ModuleVector &exported_modules,
Stream &error_stream) { … }
uint32_t
ClangModulesDeclVendorImpl::FindDecls(ConstString name, bool append,
uint32_t max_matches,
std::vector<CompilerDecl> &decls) { … }
void ClangModulesDeclVendorImpl::ForEachMacro(
const ClangModulesDeclVendor::ModuleVector &modules,
std::function<bool(llvm::StringRef, llvm::StringRef)> handler) { … }
clang::ModuleLoadResult
ClangModulesDeclVendorImpl::DoGetModule(clang::ModuleIdPath path,
bool make_visible) { … }
static const char *ModuleImportBufferName = …;
lldb_private::ClangModulesDeclVendor *
ClangModulesDeclVendor::Create(Target &target) { … }