This is an archive of the discontinued LLVM Phabricator instance.

[clang][preprocessor] Allow calling DumpToken() on annotation tokens
ClosedPublic

Authored by tbaeder on Mar 29 2022, 8:23 AM.

Details

Summary

The getSpelling() call otherwise ultimately runs into an assertion because getLength() is called on an annotation token.

Just ran into this when debugging using -dump-tokens.
Sorry I can't really find a better reviewer, the rest of that function seems to be pretty ancient.

Diff Detail

Event Timeline

tbaeder created this revision.Mar 29 2022, 8:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 8:23 AM
tbaeder requested review of this revision.Mar 29 2022, 8:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 8:23 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tbaeder updated this revision to Diff 419073.Mar 30 2022, 1:52 AM
aaron.ballman accepted this revision.Mar 30 2022, 5:30 AM

LGTM! I don't think there's a particularly strong need to add test coverage for this as the dump method is a debugging aid.

This revision is now accepted and ready to land.Mar 30 2022, 5:30 AM