And make it have no effect. Suggested at:
Details
Diff Detail
Event Timeline
The deprecated enumerator is also referenced by tools/c-index-test/c-index-test.c
This looks fine to me, but let's leave this review thread open for a week or so, to give people a bit more time to object in case they're using the flag for something.
include/clang/AST/PrettyPrinter.h | ||
---|---|---|
97–99 ↗ | (On Diff #146964) | There's no need to keep this around. We have no API stability guarantees for our C++ API. |
100–108 ↗ | (On Diff #146964) | Please explicitly mark this as being transient state that's internal to the printing algorithm and not part of its external configuration, so that people don't try to expose it again in the future. The same is true for a bunch of the other flags around here -- if we're going to do this, we should systematically examine these flags to see which ones are external configuration and which ones are internal state that we're (hackily) passing between printing steps via the PrintingPolicy. It would also make sense to move the internal state flags to a separate struct from the policy. |
This test prompted me to keep the IncludeTagDefinition member in PrintingPolicy so that clang_PrintingPolicy_getProperty would return the previous value set by clang_PrintingPolicy_setProperty. Otherwise, the value doesn't have any effect. Is that self-consistency not worth worrying about? If so, I'll remove both.
This looks fine to me, but let's leave this review thread open for a week or so, to give people a bit more time to object in case they're using the flag for something.
Sure.
include/clang/AST/PrettyPrinter.h | ||
---|---|---|
100–108 ↗ | (On Diff #146964) |
Will do.
Doing that now sounds like a lot of analysis and difficult judgment calls without much immediate gain -- at least for me as I'm not so familiar with all the flags and their potential uses from libclang. My inclination is to write a fixme and refactor gradually.
Are you ok with making the new struct a member of the existing policy to simplify the refactoring effort? |
Sorry, I was thinking of a different test. I've removed the reference you mentioned.
include/clang/AST/PrettyPrinter.h | ||
---|---|---|
97–99 ↗ | (On Diff #146964) | The test LibclangPrintingPolicyTest in unittests/libclang/LibclangTest.cpp wants clang_PrintingPolicy_getProperty to return the previous value set by clang_PrintingPolicy_setProperty for every member of CXPrintingPolicyProperty. Keeping this field makes that possible. |
I don't think it's worth worrying about. We don't guarantee that the values round-trip in general (most of them are unsigneds being written to a bool, so we don't preserve values that are neither 0 nor 1).
I was actually thinking of a different test (see my comments from today), and it wants 0 and 1 to be preserved.
Ping. Rebased. This patch intends to perform cleanup that @rsmith suggested while reviewing another patch from me. If there's no more interest, it's fine with me to abandon. I'll wait at least one more week.