[clang-tools-extra] r281920 - Trying to fix name conflict in change-namespace tool.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 10:58:59 PDT 2016


Author: ioeric
Date: Mon Sep 19 12:58:59 2016
New Revision: 281920

URL: http://llvm.org/viewvc/llvm-project?rev=281920&view=rev
Log:
Trying to fix name conflict in change-namespace tool.

Modified:
    clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
    clang-tools-extra/trunk/change-namespace/ChangeNamespace.h

Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp?rev=281920&r1=281919&r2=281920&view=diff
==============================================================================
--- clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp (original)
+++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp Mon Sep 19 12:58:59 2016
@@ -327,8 +327,8 @@ void ChangeNamespaceTool::moveOldNamespa
   MoveNs.InsertionOffset = Result.SourceManager->getFileOffset(
       Result.SourceManager->getSpellingLoc(LocAfterNs));
 
-  MoveNs.FileID = Result.SourceManager->getFileID(Start);
-  MoveNs.SourceManager = Result.SourceManager;
+  MoveNs.FID = Result.SourceManager->getFileID(Start);
+  MoveNs.SourceMgr = Result.SourceManager;
   MoveNamespaces[R.getFilePath()].push_back(MoveNs);
 }
 
@@ -447,8 +447,8 @@ void ChangeNamespaceTool::onEndOfTransla
       continue;
     const std::string &FilePath = FileAndNsMoves.first;
     auto &Replaces = FileToReplacements[FilePath];
-    auto &SM = *NsMoves.begin()->SourceManager;
-    llvm::StringRef Code = SM.getBufferData(NsMoves.begin()->FileID);
+    auto &SM = *NsMoves.begin()->SourceMgr;
+    llvm::StringRef Code = SM.getBufferData(NsMoves.begin()->FID);
     auto ChangedCode = tooling::applyAllReplacements(Code, Replaces);
     if (!ChangedCode) {
       llvm::errs() << llvm::toString(ChangedCode.takeError()) << "\n";

Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-namespace/ChangeNamespace.h?rev=281920&r1=281919&r2=281920&view=diff
==============================================================================
--- clang-tools-extra/trunk/change-namespace/ChangeNamespace.h (original)
+++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.h Mon Sep 19 12:58:59 2016
@@ -84,8 +84,8 @@ private:
     // original code.
     unsigned InsertionOffset;
     // The file in which the namespace is declared.
-    FileID FileID;
-    SourceManager *SourceManager;
+    FileID FID;
+    SourceManager *SourceMgr;
   };
 
   // Information about inserting a class forward declaration.




More information about the cfe-commits mailing list