[PATCH] D36187: [clang-diff] Use the relative name for NamedDecls

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 21 09:02:40 PDT 2017


arphaman accepted this revision.
arphaman added a comment.
This revision is now accepted and ready to land.

LG



================
Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:371
+  std::string ContextPrefix;
+  if (auto *Namespace = dyn_cast<NamespaceDecl>(Context))
+    ContextPrefix = Namespace->getQualifiedNameAsString();
----------------
johannes wrote:
> arphaman wrote:
> > You don't need to check both `NamespaceDecl` and `TagDecl`, since you can just do one if with a `NamedDecl`.
> FunctionDecl should not be used for example
Oh yeah, makes sense.


https://reviews.llvm.org/D36187





More information about the cfe-commits mailing list