Adding a SrcMgr::CharacteristicKind parameter to the InclusionDirective in PPCallbacks, and updating calls to that function. This will be useful in https://reviews.llvm.org/D43778 to determine which includes are system headers.
Details
- Reviewers
aaron.ballman - Commits
- rG6757930b01ba: [clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective
rG96fbe58b0f52: Reland '[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective'
rG36d94ab8f012: [clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective
rL332021: Reland '[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective'
rC332021: Reland '[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective'
rC331904: [clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective
rL331904: [clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective
Diff Detail
Event Timeline
LGTM with a small nit.
unittests/Lex/PPCallbacksTest.cpp | ||
---|---|---|
53 | Can you add a test that uses this field and checks its has the expected value? |
unittests/Lex/PPCallbacksTest.cpp | ||
---|---|---|
143–151 | The formatting looks off here, did clang-format do this? | |
143–151 | It would probably be cleaner to provide the old interface as well, but define it to: CharSourceRange InclusionDirectiveFilenameRange(const char* SourceText, const char* HeaderPath, bool SystemHeader) { return InclusionDirectiveCallback(SourceText, HeaderPath, SystemHeader)->FilenameRange; } |
This will break things in clang-tools-extra without D46615, so I'm going to hold off landing this until that goes through
unittests/Lex/PPCallbacksTest.cpp | ||
---|---|---|
168–169 | I'm likely just missing something, but why is the unique_ptr required at all? The Preprocessor object will be destroyed on exit from this function, so it seems like it could be an automatic variable that's passed by reference to InclusionDirectiveCallback(), and same below. |
Can you add a test that uses this field and checks its has the expected value?