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

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 03:17:14 PST 2017


ioeric 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;
----------------
alexshap wrote:
> 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) 
You are right; I was being lazy... remove the hack ;-)


https://reviews.llvm.org/D28282





More information about the cfe-commits mailing list