[clang] [clang-format] Limit how much work guessLanguage() can do (PR #78925)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 12:28:03 PST 2024


HighCommander4 wrote:

> Can we write a unit test for this?

I'm open to trying but there are a few open questions in my mind:

 * Is it fine if the failure mode of a testcase is triggering an OOM?
 * Triggering the problematic codepath requires a combination of a large file (thousands of lines) and many preprocessor branches on those lines. Should I be looking to copy one of the affected single-header libraries (e.g. miniaudio.h) into the test suite for this purpose? Or should I try to synthesize a file with dummy content that meets these criteria?

https://github.com/llvm/llvm-project/pull/78925


More information about the cfe-commits mailing list