Skip to content

Commit

Permalink
[lldb] Remove modern-type-lookup
Browse files Browse the repository at this point in the history
Summary:
As discussed on the mailing list [1] we have to make a decision for how to proceed with the modern-type-lookup.

This patch removes modern-type-lookup from LLDB. This just removes all the code behind the modern-type-lookup
setting but it does *not* remove any code from Clang (i.e., the ExternalASTMerger and the clang-import-test stay around
for now).

The motivation for this is that I don't think that the current approach of implementing modern-type-lookup
will work out. Especially creating a completely new lookup system behind some setting that is never turned on by anyone
and then one day make one big switch to the new system seems wrong. It doesn't fit into the way LLVM is developed and has
so far made the transition work much more complicated than it has to be.

A lot of the benefits that were supposed to come with the modern-type-lookup are related to having a better organization
in the way types move across LLDB and having less dependencies on unrelated LLDB code. By just looking at the current code (mostly
the ClangASTImporter) I think we can reach the same goals by just incrementally cleaning up, documenting, refactoring
and actually testing the existing code we have.

[1] http://lists.llvm.org/pipermail/lldb-dev/2019-December/015831.html

Reviewers: shafik, martong

Subscribers: rnkovacs, christof, arphaman, JDevlieghere, usaxena95, lldb-commits, friss

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D71562
  • Loading branch information
Teemperor committed Dec 17, 2019
1 parent df5a905 commit ff0102b
Show file tree
Hide file tree
Showing 24 changed files with 8 additions and 463 deletions.
13 changes: 1 addition & 12 deletions lldb/include/lldb/Symbol/ClangASTContext.h
Expand Up @@ -21,7 +21,6 @@
#include <vector>

#include "clang/AST/ASTContext.h"
#include "clang/AST/ExternalASTMerger.h"
#include "clang/AST/TemplateBase.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/SmallVector.h"
Expand Down Expand Up @@ -965,10 +964,7 @@ class ClangASTContext : public TypeSystem {

clang::DeclarationName
GetDeclarationName(const char *name, const CompilerType &function_clang_type);

virtual const clang::ExternalASTMerger::OriginMap &GetOriginMap() {
return m_origins;
}

protected:
const clang::ClassTemplateSpecializationDecl *
GetAsTemplateSpecialization(lldb::opaque_compiler_type_t type);
Expand All @@ -993,7 +989,6 @@ class ClangASTContext : public TypeSystem {
CompleteTagDeclCallback m_callback_tag_decl = nullptr;
CompleteObjCInterfaceDeclCallback m_callback_objc_decl = nullptr;
void *m_callback_baton = nullptr;
clang::ExternalASTMerger::OriginMap m_origins;
uint32_t m_pointer_byte_size = 0;
bool m_ast_owned = false;
/// The sema associated that is currently used to build this ASTContext.
Expand Down Expand Up @@ -1032,12 +1027,6 @@ class ClangASTContextForExpressions : public ClangASTContext {
const char *name) override;

PersistentExpressionState *GetPersistentExpressionState() override;

clang::ExternalASTMerger &GetMergerUnchecked();

const clang::ExternalASTMerger::OriginMap &GetOriginMap() override {
return GetMergerUnchecked().GetOrigins();
}
private:
lldb::TargetWP m_target_wp;
std::unique_ptr<PersistentExpressionState>
Expand Down
2 changes: 0 additions & 2 deletions lldb/include/lldb/Target/Target.h
Expand Up @@ -203,8 +203,6 @@ class TargetProperties : public Properties {

void SetInjectLocalVariables(ExecutionContext *exe_ctx, bool b);

bool GetUseModernTypeLookup() const;

void SetRequireHardwareBreakpoints(bool b);

bool GetRequireHardwareBreakpoints() const;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit ff0102b

Please sign in to comment.