Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lldb/include/lldb/Symbol/DeclVendor.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace lldb_private {
class DeclVendor {
public:
enum DeclVendorKind {
eClangDeclVendor,
eClangModuleDeclVendor,
eAppleObjCDeclVendor,
eLastClangDeclVendor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ add_lldb_library(lldbPluginExpressionParserClang
ClangASTImporter.cpp
ClangASTMetadata.cpp
ClangASTSource.cpp
ClangDeclVendor.cpp
ClangExpressionDeclMap.cpp
ClangExpressionHelper.cpp
ClangExpressionParser.cpp
Expand Down
32 changes: 16 additions & 16 deletions lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "ClangASTSource.h"

#include "ClangDeclVendor.h"
#include "ClangModulesDeclVendor.h"

#include "lldb/Core/Module.h"
Expand Down Expand Up @@ -799,15 +798,16 @@ void ClangASTSource::FindDeclInModules(NameSearchContext &context,

bool append = false;
uint32_t max_matches = 1;
std::vector<clang::NamedDecl *> decls;
std::vector<CompilerDecl> decls;

if (!modules_decl_vendor->FindDecls(name, append, max_matches, decls))
return;

LLDB_LOG(log, " CAS::FEVD Matching entity found for \"{0}\" in the modules",
name);

clang::NamedDecl *const decl_from_modules = decls[0];
auto *const decl_from_modules =
llvm::cast<NamedDecl>(ClangUtil::GetDecl(decls[0]));

if (llvm::isa<clang::TypeDecl>(decl_from_modules) ||
llvm::isa<clang::ObjCContainerDecl>(decl_from_modules) ||
Expand Down Expand Up @@ -849,16 +849,16 @@ void ClangASTSource::FindDeclInObjCRuntime(NameSearchContext &context,

bool append = false;
uint32_t max_matches = 1;
std::vector<clang::NamedDecl *> decls;
std::vector<CompilerDecl> decls;

auto *clang_decl_vendor = llvm::cast<ClangDeclVendor>(decl_vendor);
auto *clang_decl_vendor = llvm::cast<DeclVendor>(decl_vendor);
if (!clang_decl_vendor->FindDecls(name, append, max_matches, decls))
return;

LLDB_LOG(log, " CAS::FEVD Matching type found for \"{0}\" in the runtime",
name);

clang::Decl *copied_decl = CopyDecl(decls[0]);
clang::Decl *copied_decl = CopyDecl(ClangUtil::GetDecl(decls[0]));
clang::NamedDecl *copied_named_decl =
copied_decl ? dyn_cast<clang::NamedDecl>(copied_decl) : nullptr;

Expand Down Expand Up @@ -1081,14 +1081,14 @@ void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
ConstString interface_name(interface_decl->getNameAsString().c_str());
bool append = false;
uint32_t max_matches = 1;
std::vector<clang::NamedDecl *> decls;
std::vector<CompilerDecl> decls;

if (!modules_decl_vendor->FindDecls(interface_name, append, max_matches,
decls))
break;

ObjCInterfaceDecl *interface_decl_from_modules =
dyn_cast<ObjCInterfaceDecl>(decls[0]);
dyn_cast<ObjCInterfaceDecl>(ClangUtil::GetDecl(decls[0]));

if (!interface_decl_from_modules)
break;
Expand Down Expand Up @@ -1121,15 +1121,15 @@ void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
ConstString interface_name(interface_decl->getNameAsString().c_str());
bool append = false;
uint32_t max_matches = 1;
std::vector<clang::NamedDecl *> decls;
std::vector<CompilerDecl> decls;

auto *clang_decl_vendor = llvm::cast<ClangDeclVendor>(decl_vendor);
auto *clang_decl_vendor = llvm::cast<DeclVendor>(decl_vendor);
if (!clang_decl_vendor->FindDecls(interface_name, append, max_matches,
decls))
break;

ObjCInterfaceDecl *runtime_interface_decl =
dyn_cast<ObjCInterfaceDecl>(decls[0]);
dyn_cast<ObjCInterfaceDecl>(ClangUtil::GetDecl(decls[0]));

if (!runtime_interface_decl)
break;
Expand Down Expand Up @@ -1254,13 +1254,13 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {

bool append = false;
uint32_t max_matches = 1;
std::vector<clang::NamedDecl *> decls;
std::vector<CompilerDecl> decls;

if (!modules_decl_vendor->FindDecls(class_name, append, max_matches, decls))
break;

DeclFromUser<const ObjCInterfaceDecl> interface_decl_from_modules(
dyn_cast<ObjCInterfaceDecl>(decls[0]));
dyn_cast<ObjCInterfaceDecl>(ClangUtil::GetDecl(decls[0])));

if (!interface_decl_from_modules.IsValid())
break;
Expand Down Expand Up @@ -1297,14 +1297,14 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {

bool append = false;
uint32_t max_matches = 1;
std::vector<clang::NamedDecl *> decls;
std::vector<CompilerDecl> decls;

auto *clang_decl_vendor = llvm::cast<ClangDeclVendor>(decl_vendor);
auto *clang_decl_vendor = llvm::cast<DeclVendor>(decl_vendor);
if (!clang_decl_vendor->FindDecls(class_name, append, max_matches, decls))
break;

DeclFromUser<const ObjCInterfaceDecl> interface_decl_from_runtime(
dyn_cast<ObjCInterfaceDecl>(decls[0]));
dyn_cast<ObjCInterfaceDecl>(ClangUtil::GetDecl(decls[0])));

if (!interface_decl_from_runtime.IsValid())
break;
Expand Down
31 changes: 0 additions & 31 deletions lldb/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions lldb/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1023,13 +1023,14 @@ void ClangExpressionDeclMap::LookupInModulesDeclVendor(

bool append = false;
uint32_t max_matches = 1;
std::vector<clang::NamedDecl *> decls;
std::vector<CompilerDecl> decls;

if (!modules_decl_vendor->FindDecls(name, append, max_matches, decls))
return;

assert(!decls.empty() && "FindDecls returned true but no decls?");
clang::NamedDecl *const decl_from_modules = decls[0];
auto *const decl_from_modules =
llvm::cast<NamedDecl>(ClangUtil::GetDecl(decls[0]));

LLDB_LOG(log,
" CAS::FEVD Matching decl found for "
Expand Down Expand Up @@ -1223,7 +1224,7 @@ bool ClangExpressionDeclMap::LookupFunction(

Target *target = m_parser_vars->m_exe_ctx.GetTargetPtr();

std::vector<clang::NamedDecl *> decls_from_modules;
std::vector<CompilerDecl> decls_from_modules;

if (target) {
if (std::shared_ptr<ClangModulesDeclVendor> decl_vendor =
Expand Down Expand Up @@ -1314,7 +1315,8 @@ bool ClangExpressionDeclMap::LookupFunction(
}

if (!found_function_with_type_info) {
for (clang::NamedDecl *decl : decls_from_modules) {
for (const CompilerDecl &compiler_decl : decls_from_modules) {
clang::Decl *decl = ClangUtil::GetDecl(compiler_decl);
if (llvm::isa<clang::FunctionDecl>(decl)) {
clang::NamedDecl *copied_decl =
llvm::cast_or_null<FunctionDecl>(CopyDecl(decl));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void StoringDiagnosticConsumer::SetCurrentModuleProgress(
}

ClangModulesDeclVendor::ClangModulesDeclVendor()
: ClangDeclVendor(eClangModuleDeclVendor) {}
: DeclVendor(eClangModuleDeclVendor) {}

ClangModulesDeclVendor::~ClangModulesDeclVendor() = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
#ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGMODULESDECLVENDOR_H
#define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGMODULESDECLVENDOR_H

#include "lldb/Symbol/DeclVendor.h"
#include "lldb/Symbol/SourceModule.h"
#include "lldb/Target/Platform.h"

#include "Plugins/ExpressionParser/Clang/ClangDeclVendor.h"

#include <set>
#include <vector>

namespace lldb_private {

class ClangModulesDeclVendor : public ClangDeclVendor {
class ClangModulesDeclVendor : public DeclVendor {
public:
// Constructors and Destructors
ClangModulesDeclVendor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class lldb_private::AppleObjCExternalASTSource
};

AppleObjCDeclVendor::AppleObjCDeclVendor(ObjCLanguageRuntime &runtime)
: ClangDeclVendor(eAppleObjCDeclVendor), m_runtime(runtime),
: DeclVendor(eAppleObjCDeclVendor), m_runtime(runtime),
m_type_realizer_sp(m_runtime.GetEncodingToType()) {
m_ast_ctx = std::make_shared<TypeSystemClang>(
"AppleObjCDeclVendor AST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

#include "lldb/lldb-private.h"

#include "Plugins/ExpressionParser/Clang/ClangDeclVendor.h"
#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "lldb/Symbol/DeclVendor.h"

namespace lldb_private {

class AppleObjCExternalASTSource;

class AppleObjCDeclVendor : public ClangDeclVendor {
class AppleObjCDeclVendor : public DeclVendor {
public:
AppleObjCDeclVendor(ObjCLanguageRuntime &runtime);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ static_library("Clang") {
"ClangASTImporter.cpp",
"ClangASTMetadata.cpp",
"ClangASTSource.cpp",
"ClangDeclVendor.cpp",
"ClangExpressionDeclMap.cpp",
"ClangExpressionHelper.cpp",
"ClangExpressionParser.cpp",
Expand Down
Loading