[PATCH] D24243: [clang-move] A prototype tool for moving class definition to new file.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 08:10:05 PDT 2016


hokein added inline comments.

================
Comment at: clang-move/ClangMove.cpp:104
@@ +103,3 @@
+  std::reverse(Namespaces.begin(), Namespaces.end());
+  return Namespaces;
+}
----------------
Aha, I see. I misused the `findLocationAfterToken` previously.

================
Comment at: clang-move/ClangMove.cpp:130
@@ +129,3 @@
+  // Add #Includes.
+  std::string AllIncludesString;
+  // FIXME: Filter out the old_header.h and add header guard.
----------------
For anonymous namespace, `getNamespaces` just makes it an empty string.
Apart from that, we have to deal with other exceptions, for instance:


```
namespace a {
void A::f() {}
}
```
What we want is namespace `a`, but `getQualifiedNameAsString` returns `a::A::f`. Thus, using `getQualifiedNameAsString` wouldn't simplify the code at the moment. 



https://reviews.llvm.org/D24243





More information about the cfe-commits mailing list