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 | ||
12–13 | We shouldn't remove the include | |
24–25 | 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 | ||
12–13 | 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 | ||
---|---|---|
12–13 | 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 | 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 | 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 | There is a * here | |
libc/utils/benchmarks/LibcMemoryBenchmarkMain.cpp | ||
1 | Two trailing spaces here | |
libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp | ||
2 | No space between - and ` | |
libc/utils/testutils/ExecuteFunction.h | ||
1 | Three leading - |
This has 3 leading -