Trying to fix name conflict in change-namespace tool.
authorEric Liu <ioeric@google.com>
Mon, 19 Sep 2016 17:58:59 +0000 (17:58 +0000)
committerEric Liu <ioeric@google.com>
Mon, 19 Sep 2016 17:58:59 +0000 (17:58 +0000)
llvm-svn: 281920

clang-tools-extra/change-namespace/ChangeNamespace.cpp
clang-tools-extra/change-namespace/ChangeNamespace.h

index cf87555..2f6f364 100644 (file)
@@ -327,8 +327,8 @@ void ChangeNamespaceTool::moveOldNamespace(
   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::onEndOfTranslationUnit() {
       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";
index 6dc273d..3237c65 100644 (file)
@@ -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.