From 2d3d6dfe1c4a03e4f8ebb894221a45a65a37f90d Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Sat, 19 Sep 2015 00:10:37 +0000 Subject: [PATCH] Rename ASTSourceDescriptor::ModuleName to FullModuleName for clarity. llvm-svn: 248070 --- clang/include/clang/AST/ExternalASTSource.h | 5 +++-- clang/lib/AST/ExternalASTSource.cpp | 2 +- clang/lib/CodeGen/CGDebugInfo.cpp | 14 +++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/clang/include/clang/AST/ExternalASTSource.h b/clang/include/clang/AST/ExternalASTSource.h index 6be592f0e1f2..8f9512947db1 100644 --- a/clang/include/clang/AST/ExternalASTSource.h +++ b/clang/include/clang/AST/ExternalASTSource.h @@ -146,12 +146,13 @@ public: /// everything needed to generate debug info for an imported module /// or PCH. struct ASTSourceDescriptor { + ASTSourceDescriptor(){}; ASTSourceDescriptor(std::string Name, std::string Path, std::string ASTFile, uint64_t Signature) - : ModuleName(Name), Path(Path), ASTFile(ASTFile), + : FullModuleName(Name), Path(Path), ASTFile(ASTFile), Signature(Signature){}; ASTSourceDescriptor(const Module &M); - std::string ModuleName; + std::string FullModuleName; std::string Path; std::string ASTFile; uint64_t Signature = 0; diff --git a/clang/lib/AST/ExternalASTSource.cpp b/clang/lib/AST/ExternalASTSource.cpp index 62d41d3e4977..8d32dd23bbe4 100644 --- a/clang/lib/AST/ExternalASTSource.cpp +++ b/clang/lib/AST/ExternalASTSource.cpp @@ -29,7 +29,7 @@ ExternalASTSource::getSourceDescriptor(unsigned ID) { } ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(const Module &M) - : ModuleName(M.getFullModuleName()), Signature(M.Signature) { + : FullModuleName(M.getFullModuleName()), Signature(M.Signature) { if (M.Directory) Path = M.Directory->getName(); if (auto *File = M.getASTFile()) diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 7d6bd1668739..2743c3f28e80 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1675,7 +1675,7 @@ llvm::DIType *CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, llvm::DIModule * CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod, bool CreateSkeletonCU) { - auto &ModRef = ModuleRefCache[Mod.ModuleName]; + auto &ModRef = ModuleRefCache[Mod.FullModuleName]; if (ModRef) return cast(ModRef); @@ -1705,15 +1705,15 @@ CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod, llvm::DIModule *M = nullptr; if (CreateSkeletonCU) { llvm::DIBuilder DIB(CGM.getModule()); - auto *CU = DIB.createCompileUnit(TheCU->getSourceLanguage(), Mod.ModuleName, - Mod.Path, TheCU->getProducer(), true, - StringRef(), 0, Mod.ASTFile, - llvm::DIBuilder::FullDebug, Mod.Signature); - M = DIB.createModule(CU, Mod.ModuleName, ConfigMacros, Mod.Path, + auto *CU = DIB.createCompileUnit( + TheCU->getSourceLanguage(), Mod.FullModuleName, Mod.Path, + TheCU->getProducer(), true, StringRef(), 0, Mod.ASTFile, + llvm::DIBuilder::FullDebug, Mod.Signature); + M = DIB.createModule(CU, Mod.FullModuleName, ConfigMacros, Mod.Path, CGM.getHeaderSearchOpts().Sysroot); DIB.finalize(); } else - M = DBuilder.createModule(TheCU, Mod.ModuleName, ConfigMacros, Mod.Path, + M = DBuilder.createModule(TheCU, Mod.FullModuleName, ConfigMacros, Mod.Path, CGM.getHeaderSearchOpts().Sysroot); ModRef.reset(M); return M;