diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
commit | 3176e97f130184ece0e1a21352c8124cc83ff24a (patch) | |
tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /lib/AST/ExternalASTSource.cpp | |
parent | 1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (diff) | |
download | FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.zip FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.tar.gz |
Vendor import of clang trunk r256633:
https://llvm.org/svn/llvm-project/cfe/trunk@256633
Diffstat (limited to 'lib/AST/ExternalASTSource.cpp')
-rw-r--r-- | lib/AST/ExternalASTSource.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/AST/ExternalASTSource.cpp b/lib/AST/ExternalASTSource.cpp index 1c82c35..e3de8c5 100644 --- a/lib/AST/ExternalASTSource.cpp +++ b/lib/AST/ExternalASTSource.cpp @@ -16,6 +16,7 @@ #include "clang/AST/ExternalASTSource.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclarationName.h" +#include "clang/Basic/Module.h" #include "llvm/Support/ErrorHandling.h" using namespace clang; @@ -27,9 +28,19 @@ ExternalASTSource::getSourceDescriptor(unsigned ID) { return None; } -ExternalASTSource::ASTSourceDescriptor -ExternalASTSource::getSourceDescriptor(const Module &M) { - return ASTSourceDescriptor(); +ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(const Module &M) + : Signature(M.Signature), ClangModule(&M) { + if (M.Directory) + Path = M.Directory->getName(); + if (auto *File = M.getASTFile()) + ASTFile = File->getName(); +} + +std::string ExternalASTSource::ASTSourceDescriptor::getModuleName() const { + if (ClangModule) + return ClangModule->Name; + else + return PCHModuleName; } void ExternalASTSource::FindFileRegionDecls(FileID File, unsigned Offset, @@ -92,17 +103,13 @@ ExternalASTSource::FindExternalVisibleDeclsByName(const DeclContext *DC, return false; } -void ExternalASTSource::completeVisibleDeclsMap(const DeclContext *DC) { -} +void ExternalASTSource::completeVisibleDeclsMap(const DeclContext *DC) {} -ExternalLoadResult -ExternalASTSource::FindExternalLexicalDecls(const DeclContext *DC, - bool (*isKindWeWant)(Decl::Kind), - SmallVectorImpl<Decl*> &Result) { - return ELR_AlreadyLoaded; -} +void ExternalASTSource::FindExternalLexicalDecls( + const DeclContext *DC, llvm::function_ref<bool(Decl::Kind)> IsKindWeWant, + SmallVectorImpl<Decl *> &Result) {} -void ExternalASTSource::getMemoryBufferSizes(MemoryBufferSizes &sizes) const { } +void ExternalASTSource::getMemoryBufferSizes(MemoryBufferSizes &sizes) const {} uint32_t ExternalASTSource::incrementGeneration(ASTContext &C) { uint32_t OldGeneration = CurrentGeneration; |