Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ClangExpressionParser] Add ClangDeclVendor
Summary: This introduces a layer between DeclVendor and the currently implemented DeclVendors (ClangModulesDeclVendor and AppleObjCDeclVendor). This allows the removal of DeclVendor::GetImporterSource which is extremely clang-specific, freeing up the interface to be more general. A good follow up to this would be to remove the remaining instances of clang in DeclVendor, either by moving things to ClangDeclVendor or by using wrappers (e.g. CompilerDecl instead of clang::NamedDecl). Differential Revision: https://reviews.llvm.org/D66451 llvm-svn: 369424
- Loading branch information
Showing
7 changed files
with
81 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
lldb/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//===-- ClangDeclVendor.h ---------------------------------------*- C++ -*-===// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef liblldb_ClangDeclVendor_h_ | ||
#define liblldb_ClangDeclVendor_h_ | ||
|
||
#include "lldb/Symbol/DeclVendor.h" | ||
|
||
#include "clang/AST/ExternalASTMerger.h" | ||
|
||
namespace lldb_private { | ||
|
||
// A clang specialized extension to DeclVendor. | ||
class ClangDeclVendor : public DeclVendor { | ||
public: | ||
ClangDeclVendor(DeclVendorKind kind) : DeclVendor(kind) {} | ||
|
||
virtual ~ClangDeclVendor() {} | ||
|
||
/// Interface for ExternalASTMerger. Returns an ImporterSource allowing type | ||
/// completion. | ||
/// | ||
/// \return | ||
/// An ImporterSource for this ClangDeclVendor. | ||
virtual clang::ExternalASTMerger::ImporterSource GetImporterSource() = 0; | ||
|
||
static bool classof(const DeclVendor *vendor) { | ||
return vendor->GetKind() >= eClangDeclVendor && | ||
vendor->GetKind() < eLastClangDeclVendor; | ||
} | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(ClangDeclVendor); | ||
}; | ||
}; // namespace lldb_private | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters