diff options
-rw-r--r-- | include/clang/Basic/SourceManager.h | 30 | ||||
-rw-r--r-- | include/clang/Frontend/DiagnosticRenderer.h | 2 | ||||
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 12 | ||||
-rw-r--r-- | lib/Frontend/DiagnosticRenderer.cpp | 20 |
4 files changed, 32 insertions, 32 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index d79cbfe5ae..c515120f53 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -514,10 +514,10 @@ public: }; -/// \brief The path used when building modules on demand, which is used +/// \brief The stack used when building modules on demand, which is used /// to provide a link between the source managers of the different compiler /// instances. -typedef llvm::ArrayRef<std::pair<std::string, FullSourceLoc> > ModuleBuildPath; +typedef llvm::ArrayRef<std::pair<std::string, FullSourceLoc> > ModuleBuildStack; /// \brief This class handles loading and caching of source files into memory. /// @@ -656,14 +656,14 @@ class SourceManager : public RefCountedBase<SourceManager> { mutable llvm::DenseMap<FileID, MacroArgsMap *> MacroArgsCacheMap; - /// \brief The path of modules being built, which is used to detect + /// \brief The stack of modules being built, which is used to detect /// cycles in the module dependency graph as modules are being built, as - /// well as to describe + /// well as to describe why we're rebuilding a particular module. /// /// There is no way to set this value from the command line. If we ever need /// to do so (e.g., if on-demand module construction moves out-of-process), /// we can add a cc1-level option to do so. - SmallVector<std::pair<std::string, FullSourceLoc>, 2> StoredModuleBuildPath; + SmallVector<std::pair<std::string, FullSourceLoc>, 2> StoredModuleBuildStack; // SourceManager doesn't support copy construction. explicit SourceManager(const SourceManager&) LLVM_DELETED_FUNCTION; @@ -689,20 +689,20 @@ public: /// (likely to change while trying to use them). bool userFilesAreVolatile() const { return UserFilesAreVolatile; } - /// \brief Retrieve the module build path. - ModuleBuildPath getModuleBuildPath() const { - return StoredModuleBuildPath; + /// \brief Retrieve the module build stack. + ModuleBuildStack getModuleBuildStack() const { + return StoredModuleBuildStack; } - /// \brief Set the module build path. - void setModuleBuildPath(ModuleBuildPath path) { - StoredModuleBuildPath.clear(); - StoredModuleBuildPath.append(path.begin(), path.end()); + /// \brief Set the module build stack. + void setModuleBuildStack(ModuleBuildStack stack) { + StoredModuleBuildStack.clear(); + StoredModuleBuildStack.append(stack.begin(), stack.end()); } - /// \brief Append an entry to the module build path. - void appendModuleBuildPath(StringRef moduleName, FullSourceLoc importLoc) { - StoredModuleBuildPath.push_back(std::make_pair(moduleName.str(),importLoc)); + /// \brief Push an entry to the module build stack. + void pushModuleBuildStack(StringRef moduleName, FullSourceLoc importLoc) { + StoredModuleBuildStack.push_back(std::make_pair(moduleName.str(),importLoc)); } /// \brief Create the FileID for a memory buffer that will represent the diff --git a/include/clang/Frontend/DiagnosticRenderer.h b/include/clang/Frontend/DiagnosticRenderer.h index f46eb5c500..4c22e2a3c9 100644 --- a/include/clang/Frontend/DiagnosticRenderer.h +++ b/include/clang/Frontend/DiagnosticRenderer.h @@ -113,7 +113,7 @@ private: void emitImportStack(SourceLocation Loc, const SourceManager &SM); void emitImportStackRecursively(SourceLocation Loc, StringRef ModuleName, const SourceManager &SM); - void emitModuleBuildPath(const SourceManager &SM); + void emitModuleBuildStack(const SourceManager &SM); void emitMacroExpansionsAndCarets(SourceLocation Loc, DiagnosticsEngine::Level Level, SmallVectorImpl<CharSourceRange>& Ranges, diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 150f99578c..d481ebf511 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -859,14 +859,14 @@ static void compileModule(CompilerInstance &ImportingInstance, /*ShouldOwnClient=*/true, /*ShouldCloneClient=*/true); - // Note that this module is part of the module build path, so that we + // Note that this module is part of the module build stack, so that we // can detect cycles in the module graph. Instance.createFileManager(); // FIXME: Adopt file manager from importer? Instance.createSourceManager(Instance.getFileManager()); SourceManager &SourceMgr = Instance.getSourceManager(); - SourceMgr.setModuleBuildPath( - ImportingInstance.getSourceManager().getModuleBuildPath()); - SourceMgr.appendModuleBuildPath(Module->getTopLevelModuleName(), + SourceMgr.setModuleBuildStack( + ImportingInstance.getSourceManager().getModuleBuildStack()); + SourceMgr.pushModuleBuildStack(Module->getTopLevelModuleName(), FullSourceLoc(ImportLoc, ImportingInstance.getSourceManager())); @@ -947,8 +947,8 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, // build the module. // Check whether there is a cycle in the module graph. - ModuleBuildPath Path = getSourceManager().getModuleBuildPath(); - ModuleBuildPath::iterator Pos = Path.begin(), PosEnd = Path.end(); + ModuleBuildStack Path = getSourceManager().getModuleBuildStack(); + ModuleBuildStack::iterator Pos = Path.begin(), PosEnd = Path.end(); for (; Pos != PosEnd; ++Pos) { if (Pos->first == ModuleName) break; diff --git a/lib/Frontend/DiagnosticRenderer.cpp b/lib/Frontend/DiagnosticRenderer.cpp index 4a332ae82f..c2128878da 100644 --- a/lib/Frontend/DiagnosticRenderer.cpp +++ b/lib/Frontend/DiagnosticRenderer.cpp @@ -205,7 +205,7 @@ void DiagnosticRenderer::emitIncludeStack(SourceLocation Loc, if (IncludeLoc.isValid()) emitIncludeStackRecursively(IncludeLoc, SM); else { - emitModuleBuildPath(SM); + emitModuleBuildStack(SM); emitImportStack(Loc, SM); } } @@ -215,7 +215,7 @@ void DiagnosticRenderer::emitIncludeStack(SourceLocation Loc, void DiagnosticRenderer::emitIncludeStackRecursively(SourceLocation Loc, const SourceManager &SM) { if (Loc.isInvalid()) { - emitModuleBuildPath(SM); + emitModuleBuildStack(SM); return; } @@ -244,7 +244,7 @@ void DiagnosticRenderer::emitIncludeStackRecursively(SourceLocation Loc, void DiagnosticRenderer::emitImportStack(SourceLocation Loc, const SourceManager &SM) { if (Loc.isInvalid()) { - emitModuleBuildPath(SM); + emitModuleBuildStack(SM); return; } @@ -275,17 +275,17 @@ void DiagnosticRenderer::emitImportStackRecursively(SourceLocation Loc, emitImportLocation(Loc, PLoc, ModuleName, SM); } -/// \brief Emit the module build path, for cases where a module is (re-)built +/// \brief Emit the module build stack, for cases where a module is (re-)built /// on demand. -void DiagnosticRenderer::emitModuleBuildPath(const SourceManager &SM) { - ModuleBuildPath Path = SM.getModuleBuildPath(); - for (unsigned I = 0, N = Path.size(); I != N; ++I) { - const SourceManager &CurSM = Path[I].second.getManager(); - SourceLocation CurLoc = Path[I].second; +void DiagnosticRenderer::emitModuleBuildStack(const SourceManager &SM) { + ModuleBuildStack Stack = SM.getModuleBuildStack(); + for (unsigned I = 0, N = Stack.size(); I != N; ++I) { + const SourceManager &CurSM = Stack[I].second.getManager(); + SourceLocation CurLoc = Stack[I].second; emitBuildingModuleLocation(CurLoc, CurSM.getPresumedLoc(CurLoc, DiagOpts->ShowPresumedLoc), - Path[I].first, + Stack[I].first, CurSM); } } |