diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-09-19 00:10:32 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-09-19 00:10:32 +0000 |
commit | c6458d6a4d3b5b8b95794f05c555990f9b037b82 (patch) | |
tree | a7bcb64a75be80913992332278c6e6b10a2b4fcc /clang/lib/AST/ExternalASTSource.cpp | |
parent | 8bd4c13f6762220ce4c3e5121e53d0a38fe7eb99 (diff) | |
download | bcm5719-llvm-c6458d6a4d3b5b8b95794f05c555990f9b037b82.tar.gz bcm5719-llvm-c6458d6a4d3b5b8b95794f05c555990f9b037b82.zip |
Refactor ASTReader::getSourceDescriptor(const Module &) into a constructor
of ASTSourceDescriptor. It was effectively a static function.
NFC.
llvm-svn: 248069
Diffstat (limited to 'clang/lib/AST/ExternalASTSource.cpp')
-rw-r--r-- | clang/lib/AST/ExternalASTSource.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/AST/ExternalASTSource.cpp b/clang/lib/AST/ExternalASTSource.cpp index 8a44c05dbb7..62d41d3e497 100644 --- a/clang/lib/AST/ExternalASTSource.cpp +++ b/clang/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,12 @@ ExternalASTSource::getSourceDescriptor(unsigned ID) { return None; } -ExternalASTSource::ASTSourceDescriptor -ExternalASTSource::getSourceDescriptor(const Module &M) { - return ASTSourceDescriptor(); +ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(const Module &M) + : ModuleName(M.getFullModuleName()), Signature(M.Signature) { + if (M.Directory) + Path = M.Directory->getName(); + if (auto *File = M.getASTFile()) + ASTFile = File->getName(); } void ExternalASTSource::FindFileRegionDecls(FileID File, unsigned Offset, |