Made all header files consistent based of this documentation: https://llvm.org/docs/CodingStandards.html#file-headers.
And did the same for all source files top of file comments.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/include/__llvm-libc-common.h | ||
---|---|---|
1 | Looks like there is a - --- which we should make ---. Also should these have -*- C++ -*-? | |
libc/include/__posix-types.h | ||
1 | Same for the C++ tag here. | |
libc/include/ctype.h | ||
1 | Here as well, or at least we should remove the * | |
libc/utils/CPP/StringRef.h | ||
9–10 | We shouldn't remove the include | |
21–22 | Newline |
Also, although we only want header files to have the C++ tag, shouldn't we also left justify the text in our .cpp files too?
libc/include/__llvm-libc-common.h | ||
---|---|---|
1 | We shouldn't have C++ here as these are public C headers. The rest of the comment is valid. | |
libc/include/__posix-types.h | ||
1 | Same with C++ here. | |
libc/include/ctype.h | ||
1 | I noticed this as well :) | |
libc/utils/CPP/StringRef.h | ||
9–10 | Thanks for catching this. |
Yes, at least for consistency.
For future integrity, are there are any clang-format/clang-tidy rules which can warn us about such misses? For bad/missing headers guards, there are clang-tidy rules available for LLVM.
I'll look into this, I'm sure a check exists or we can make one.
libc/utils/CPP/StringRef.h | ||
---|---|---|
9–10 | oops! thank you for catching this! |
I continue to accept this. But, I missed some obvious things previously so, wait for @abrachet to take a look as well.
One thing though, this change is now wider than the original description. So, update the description here (and also in your local git repo if you use git llvm push.)
Just some nits inline.
One thing though, this change is now wider than the original description. So, update the description here (and also in your local git repo if you use git llvm push.)
It might also be useful to add [NFC] to the name while you're at it.
My guess although I'm not sure is it would be difficult to get this into clang-format because it's very LLVM specific. I also don't know if it would work in clang-tidy, I'm not sure if comments are expressed in the AST but @PaulkaToast would know more than me :) It would be very useful for one of these tools to do this for us for sure.
libc/config/linux/errno.h.in | ||
---|---|---|
1 ↗ | (On Diff #255432) | This has 3 leading - |
libc/include/__llvm-libc-common.h | ||
1 | You're right we shouldn't have them in the public headers. libcxx does this but they also have no extension at all not just .h, also most of headers are generated so its very little use to us. | |
libc/src/threads/linux/thread_start_args.h.def | ||
1 ↗ | (On Diff #255432) | Add an extra - at the end, the * is right next to the = |
libc/utils/CPP/StringRef.h | ||
1 | Looks like two spaces between type and - | |
libc/utils/HdrGen/PublicAPICommand.cpp | ||
1 ↗ | (On Diff #255432) | There is a * here |
libc/utils/benchmarks/LibcMemoryBenchmarkMain.cpp | ||
1 ↗ | (On Diff #255432) | Two trailing spaces here |
libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp | ||
1 ↗ | (On Diff #255432) | No space between - and ` |
libc/utils/testutils/ExecuteFunction.h | ||
1 | Three leading - |
Looks like there is a - --- which we should make ---. Also should these have -*- C++ -*-?