- replace SymbolLocation std::variant with enum-exposing version similar to those in types.cpp. There's no appropriate implementation file, added LocateSymbol.cpp in anticipation of locateDecl/locateMacro.
- FindHeaders is not part of the public Analysis interface, so should not be implemented/tested there (just code organization)
- rename findIncludeHeaders->findHeaders to avoid confusion with Include concept
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
You could:
static_assert(std::variant_size_v<....> == 2); Kind kind() const { if (std::holds_alternative<SourceLocation>(Storage)) return Kind::Physical; return Kind::Standard; }
and Kind could become enum class Kind. => You would get rid of the order on the variant and the static_cast.
Comment Actions
Sure, but that's IMO less regular, harder to understand, and easier to get wrong when updating.