[PATCH] D125109: [clangd] Rewrite TweakTesting helpers to avoid reparsing the same code. NFC

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 6 11:07:10 PDT 2022


sammccall created this revision.
sammccall added a reviewer: ilya-biryukov.
Herald added subscribers: usaxena95, kadircet, arphaman.
Herald added a project: All.
sammccall requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang-tools-extra.

Previously the EXPECT_AVAILABLE macros would rebuild the code at each marked
point, by expanding the cases textually.
There were often lots, and it's nice to have lots!

This reduces total unittest time by ~10% on my machine.
I did have to sacrifice a little apply() coverage in AddUsingTests (was calling
expandCases directly, which was otherwise unused), but we have
EXPECT_AVAILABLE tests covering that, I don't think there's real risk here.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125109

Files:
  clang-tools-extra/clangd/unittests/tweaks/AddUsingTests.cpp
  clang-tools-extra/clangd/unittests/tweaks/TweakTesting.cpp
  clang-tools-extra/clangd/unittests/tweaks/TweakTesting.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125109.427683.patch
Type: text/x-patch
Size: 11159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220506/83787172/attachment-0001.bin>


More information about the cfe-commits mailing list