[cfe-commits] r169045 - in /cfe/trunk: include/clang/Basic/SourceManager.h include/clang/Frontend/DiagnosticRenderer.h lib/Frontend/CompilerInstance.cpp lib/Frontend/DiagnosticRenderer.cpp

Douglas Gregor dgregor at apple.com
Fri Nov 30 14:11:58 PST 2012


Author: dgregor
Date: Fri Nov 30 16:11:57 2012
New Revision: 169045

URL: http://llvm.org/viewvc/llvm-project?rev=169045&view=rev
Log:
Rename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!

Modified:
    cfe/trunk/include/clang/Basic/SourceManager.h
    cfe/trunk/include/clang/Frontend/DiagnosticRenderer.h
    cfe/trunk/lib/Frontend/CompilerInstance.cpp
    cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp

Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=169045&r1=169044&r2=169045&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Fri Nov 30 16:11:57 2012
@@ -514,10 +514,10 @@
 
 };
 
-/// \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 @@
 
   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 @@
   /// (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

Modified: cfe/trunk/include/clang/Frontend/DiagnosticRenderer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/DiagnosticRenderer.h?rev=169045&r1=169044&r2=169045&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/DiagnosticRenderer.h (original)
+++ cfe/trunk/include/clang/Frontend/DiagnosticRenderer.h Fri Nov 30 16:11:57 2012
@@ -113,7 +113,7 @@
   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,

Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=169045&r1=169044&r2=169045&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Fri Nov 30 16:11:57 2012
@@ -859,14 +859,14 @@
                              /*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 @@
       // 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;

Modified: cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp?rev=169045&r1=169044&r2=169045&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp (original)
+++ cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp Fri Nov 30 16:11:57 2012
@@ -205,7 +205,7 @@
   if (IncludeLoc.isValid())
     emitIncludeStackRecursively(IncludeLoc, SM);
   else {
-    emitModuleBuildPath(SM);
+    emitModuleBuildStack(SM);
     emitImportStack(Loc, SM);
   }
 }
@@ -215,7 +215,7 @@
 void DiagnosticRenderer::emitIncludeStackRecursively(SourceLocation Loc,
                                                      const SourceManager &SM) {
   if (Loc.isInvalid()) {
-    emitModuleBuildPath(SM);
+    emitModuleBuildStack(SM);
     return;
   }
   
@@ -244,7 +244,7 @@
 void DiagnosticRenderer::emitImportStack(SourceLocation Loc,
                                          const SourceManager &SM) {
   if (Loc.isInvalid()) {
-    emitModuleBuildPath(SM);
+    emitModuleBuildStack(SM);
     return;
   }
 
@@ -275,17 +275,17 @@
   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);
   }
 }





More information about the cfe-commits mailing list