[PATCH] D25309: [clang-move] Support moving multiple classes in one run.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 01:56:34 PDT 2016


ioeric added inline comments.


================
Comment at: clang-move/ClangMove.cpp:316
   auto InMovedClass =
-      hasDeclContext(cxxRecordDecl(hasName(FullyQualifiedName)));
+      hasDeclContext(cxxRecordDecl(*InMovedClassNames));
 
----------------
ioeric wrote:
> hokein wrote:
> > ioeric wrote:
> > > What would happen if `InMovedClassNames == false`?
> > "InMovedClassNames" should not be false in the matcher. Added an assert.
> I think you should instead exit early if `ClassNames.empty()` or assert not empty.
Test nested comments.


================
Comment at: clang-move/ClangMove.cpp:291-297
     CCIncludes.push_back("#include \"" + Spec.NewHeader + "\"\n");
 }
 
 void ClangMoveTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
-  std::string FullyQualifiedName = "::" + Spec.Name;
+  SmallVector<StringRef, 4> ClassNames;
+  llvm::StringRef(Spec.Names).split(ClassNames, ',');
+  Optional<ast_matchers::internal::Matcher<NamedDecl>> InMovedClassNames;
----------------
Spamming.

Test phabricator.


https://reviews.llvm.org/D25309





More information about the cfe-commits mailing list