[PATCH] D90010: clang-tidy: Reduce number of stderr write calls

Hiral via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 27 01:42:43 PDT 2020


Hiralo added a comment.

Another observation w.r.t. stdout...

For example, consider following sample program:
<sample_code>
#include <iostream>
#include <string>

using namespace std;
static long long A = 0ull;

void f(const std::string& a) {

  std::cout << a << std::endl;

}

int main() {
}
</sample_code>

When running clang-tidy on this... we can see about 343 stdout write calls...
e.g. 
write(1, "\33[1m", 4)                   = 4
write(1, "/some/path/a.cc", 14)          = 14
write(1, ":", 1)                        = 1
write(1, "4", 1)                        = 1
write(1, ":", 1)                        = 1
write(1, "1", 1)                        = 1
write(1, ":", 1)                        = 1
write(1, " ", 1)                        = 1
write(1, "\33[0m", 4)                   = 4
write(1, "\33[0;1;35m", 9)              = 9
write(1, "warning", 7)                  = 7
write(1, ": ", 2)                       = 2
write(1, "\33[0m", 4)                   = 4
write(1, "\33[1m", 4)                   = 4
write(1, "do not use namespace using-direc"..., 100) = 100
write(1, "\33[0m", 4)                   = 4
write(1, "\n", 1)                       = 1
write(1, "using namespace std;", 20)    = 20
write(1, "\n", 1)                       = 1
write(1, "\33[0;1;32m", 9)              = 9
write(1, "^", 1)                        = 1
write(1, "\n", 1)                       = 1
write(1, "\33[0m", 4)                   = 4
write(1, "\33[1m", 4)                   = 4
...

Shouldn't clang-tidy stdout with reasonable buffer-size (e.g. 128 or 512 or 1024) ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90010/new/

https://reviews.llvm.org/D90010



More information about the cfe-commits mailing list