llvm/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp

//===-- ClangModulesDeclVendor.cpp ----------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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 {
/// Any Clang compiler requires a consumer for diagnostics.  This one stores
/// them as strings so we can provide them to the user in case a module failed
/// to load.
class StoringDiagnosticConsumer : public clang::DiagnosticConsumer {};

/// The private implementation of our ClangModulesDeclVendor.  Contains all the
/// Clang state required to load modules.
class ClangModulesDeclVendorImpl : public ClangModulesDeclVendor {};
} // anonymous namespace

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) {}

// ClangImporter::lookupValue

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) {}