Not sure how to test this - adding it to c-index-test's PrintType will change *everything*, which doesn't seem like a great idea.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
In terms of testing, I'd recommend adding -test-print-qualified-type and see if you can thread a qualified vs unqualified parameter through PrintType() and friends to try to share as much code as possible. You'll probably need new wrapper functions that calls PrintType with the correct argument value depending on which test is being run. WDYT?
clang/tools/libclang/CXType.cpp | ||
---|---|---|
318–325 | Simplifying a bit and fixing up a naming convention nit. |
Now tested by adding a -print-qualified-type-names flag to c-index-test and creating a (small) dedicated test in print-qualified-type.cpp
This looks like the right direction to me, but there's quite a few whitespace and formatting NFC changes in the patch. If you don't mind splitting those changes out into their own commit, that would be appreciated (feel free to land those changes without review given that they're only changing whitespace and other formatting).
clang/tools/c-index-test/c-index-test.c | ||
---|---|---|
378 | ||
1789 | I'm not super familiar with c-index-test -- how certain are you that the client data will 1) be non-null, and 2) actually be a VisitorData pointer? |
Re the whitespace - yeah that's me running clang-format on the whole function rather than just the lines I changed. I'll see if I can split those out.
clang/tools/c-index-test/c-index-test.c | ||
---|---|---|
1789 | This was just copy-pasted from another function. I'm as certain as I can be given that all the tests pass :\ |
clang/tools/c-index-test/c-index-test.c | ||
---|---|---|
1789 | From a quick scan, VisitorData is the only CXClientData struct used in the visitor callbacks, so I think we're safe. |
LGTM!
clang/tools/c-index-test/c-index-test.c | ||
---|---|---|
1789 | Thanks! That matches what I was seeing as well, great. |
clang-format not found in user’s local PATH; not linting file.