[PATCH] D28282: [change-namespace] get whitespaces right when moving old namespaces.

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 02:57:12 PST 2017


alexshap added inline comments.


================
Comment at: change-namespace/ChangeNamespace.cpp:563
+  // Create a replacement merely for retrieving file path and start offset.
+  const auto R = createReplacement(Start, Start, "", *Result.SourceManager);
   MoveNamespace MoveNs;
----------------
maybe i am missing smth, to be honest i somehow think this code is "hacky" / looks like a "workaround", so don't like the idea of creating a replacement only for extracting the  offset / filepath.
I would prefer to refactor this (+ SourceManager ?) to get rid of these hacks (they create extra "tech debt" plus decrease the readability) 


https://reviews.llvm.org/D28282





More information about the cfe-commits mailing list