By special-casing them at the moment. The tooling stdlib lib doesn't
support these symbols (most important one is std::move).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/include-cleaner/lib/FindHeaders.cpp | ||
---|---|---|
104 | nit: else if | |
110 | we also need to account for exporters, similar to findHeaders. might be worth lifting that branch to a free-function. | |
187 | rather than doing this here and bailing out early, i think we should just augment the Headers below, after locateSymbol and findHeaders is run. that way we'll make sure rest of the logic applies in the future without special casing (e.g. we've some fixmes for treating implementation locations for stdlib symbols as providers, in such a scenario this early exits would create non-uniformity). so what about an alternative with a signature like: llvm::SmallVector<Hinted<Header>> headersForSpecialSymbols(S, SM, PI); then we can just initialize Headers with a call to it? |
clang-tools-extra/include-cleaner/lib/FindHeaders.cpp | ||
---|---|---|
187 |
I'm not sure about it. Looks like this is subtle, it creates discrepancies for standard symbols, these special std symbols will have the underlying header as alternative while other normal std-recognizer symbols not. I think it would be better to be consistent for all std symbols. |
thanks!
clang-tools-extra/include-cleaner/lib/FindHeaders.cpp | ||
---|---|---|
85 | we actually need to nullcheck for PI here, defaulting to PublicHeader when it isn't present. | |
86 | nit: maybe unwrap this? e.g: if (PI->isPrivate(..) ... ) return Hints::None; return Hints::PublicHeader; | |
95 | we need to nullcheck for PI here | |
134 | can you also wrap this in applyHints(..., Hints::CompleteSymbol), similar to what locateSymbol does for rest of the stdlib symbols |
Thanks for the review!
clang-tools-extra/include-cleaner/lib/FindHeaders.cpp | ||
---|---|---|
85 | ah, I think we can make it a reference, all callsites can guarantee the PI is nonnull. |
we actually need to nullcheck for PI here, defaulting to PublicHeader when it isn't present.