Skip to content

Commit 427826d

Browse files
committed
---
yaml --- r: 349392 b: refs/heads/master-next c: 4801938 h: refs/heads/master
1 parent 13a628a commit 427826d

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 351bed741c2cc857ff029f766d4b73736b02684a
3+
refs/heads/master-next: 4801938d366cbc4f1f7bdb63598f619a40c96c4e
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/include/swift/AST/ClangModuleLoader.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,33 @@ class ClangModuleLoader : public ModuleLoader {
7171
virtual bool
7272
isInOverlayModuleForImportedModule(const DeclContext *overlayDC,
7373
const DeclContext *importedDC) = 0;
74+
75+
/// Look for declarations associated with the given name.
76+
///
77+
/// \param name The name we're searching for.
78+
virtual void lookupValue(DeclName name, VisibleDeclConsumer &consumer) = 0;
79+
80+
/// Look up a type declaration by its Clang name.
81+
///
82+
/// Note that this method does no filtering. If it finds the type in a loaded
83+
/// module, it returns it. This is intended for use in reflection / debugging
84+
/// contexts where access is not a problem.
85+
virtual void
86+
lookupTypeDecl(StringRef clangName, ClangTypeKind kind,
87+
llvm::function_ref<void(TypeDecl *)> receiver) = 0;
88+
89+
/// Look up type a declaration synthesized by the Clang importer itself, using
90+
/// a "related entity kind" to determine which type it should be. For example,
91+
/// this can be used to find the synthesized error struct for an
92+
/// NS_ERROR_ENUM.
93+
///
94+
/// Note that this method does no filtering. If it finds the type in a loaded
95+
/// module, it returns it. This is intended for use in reflection / debugging
96+
/// contexts where access is not a problem.
97+
virtual void
98+
lookupRelatedEntity(StringRef clangName, ClangTypeKind kind,
99+
StringRef relatedEntityKind,
100+
llvm::function_ref<void(TypeDecl *)> receiver) = 0;
74101
};
75102

76103
} // namespace swift

branches/master-next/include/swift/ClangImporter/ClangImporter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ class ClangImporter final : public ClangModuleLoader {
172172
/// Look for declarations associated with the given name.
173173
///
174174
/// \param name The name we're searching for.
175-
void lookupValue(DeclName name, VisibleDeclConsumer &consumer);
175+
void lookupValue(DeclName name, VisibleDeclConsumer &consumer) override;
176176

177177
/// Look up a type declaration by its Clang name.
178178
///
179179
/// Note that this method does no filtering. If it finds the type in a loaded
180180
/// module, it returns it. This is intended for use in reflection / debugging
181181
/// contexts where access is not a problem.
182182
void lookupTypeDecl(StringRef clangName, ClangTypeKind kind,
183-
llvm::function_ref<void(TypeDecl *)> receiver);
183+
llvm::function_ref<void(TypeDecl *)> receiver) override;
184184

185185
/// Look up type a declaration synthesized by the Clang importer itself, using
186186
/// a "related entity kind" to determine which type it should be. For example,
@@ -193,7 +193,7 @@ class ClangImporter final : public ClangModuleLoader {
193193
void
194194
lookupRelatedEntity(StringRef clangName, ClangTypeKind kind,
195195
StringRef relatedEntityKind,
196-
llvm::function_ref<void(TypeDecl *)> receiver);
196+
llvm::function_ref<void(TypeDecl *)> receiver) override;
197197

198198
/// Look for textually included declarations from the bridging header.
199199
///

branches/master-next/lib/AST/ASTDemangler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
#include "swift/AST/ASTDemangler.h"
2323

2424
#include "swift/AST/ASTContext.h"
25+
#include "swift/AST/ClangModuleLoader.h"
2526
#include "swift/AST/Decl.h"
2627
#include "swift/AST/GenericSignature.h"
2728
#include "swift/AST/GenericSignatureBuilder.h"
2829
#include "swift/AST/Module.h"
2930
#include "swift/AST/NameLookup.h"
3031
#include "swift/AST/Type.h"
3132
#include "swift/AST/Types.h"
32-
#include "swift/ClangImporter/ClangImporter.h"
3333
#include "swift/Demangling/Demangler.h"
3434
#include "swift/Demangling/ManglingMacros.h"
3535
#include "llvm/ADT/StringSwitch.h"
@@ -1069,7 +1069,7 @@ GenericTypeDecl *ASTBuilder::findForeignTypeDecl(StringRef name,
10691069
ForeignModuleKind foreignKind,
10701070
Demangle::Node::Kind kind) {
10711071
// Check to see if we have an importer loaded.
1072-
auto importer = static_cast<ClangImporter *>(Ctx.getClangModuleLoader());
1072+
auto importer = Ctx.getClangModuleLoader();
10731073
if (!importer)
10741074
return nullptr;
10751075

0 commit comments

Comments
 (0)