[PATCH] D24322: clang-format: [JavaScript] Do requoting in a separate pass

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 7 15:45:34 PDT 2016


djasper added inline comments.

================
Comment at: lib/Format/Format.cpp:1707
@@ +1706,3 @@
+      if (NewCode) {
+        auto NewEnv = Environment::CreateVirtualEnvironment(
+            *NewCode, FileName,
----------------
mprobst wrote:
> I guess we don't worry about the performance consequences here?
I don't think so. Lexing is very fast and we do the same thing to sort includes. We only create a new virtual environment if there actually are quotes to change which should be rare and also creating this environment should be fast.

All in all, I'd ignore performance here until this actually shows up in a profile (or we trace a slow formatting back to it).


https://reviews.llvm.org/D24322





More information about the cfe-commits mailing list