This is an archive of the discontinued LLVM Phabricator instance.

[clang][Sema][NFC] Save token name instead of the full token
ClosedPublic

Authored by tbaeder on Apr 5 2023, 7:25 AM.

Details

Summary

This makes it a bit clearer why we're saving the token (so no need for the later comment).

I'm just not 100% sure about the lifetime of the token name.

Diff Detail

Event Timeline

tbaeder created this revision.Apr 5 2023, 7:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2023, 7:25 AM
tbaeder requested review of this revision.Apr 5 2023, 7:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2023, 7:25 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
shafik added a subscriber: shafik.Apr 5 2023, 6:56 PM
shafik added inline comments.
clang/lib/Parse/ParseDeclCXX.cpp
962

It looks like this comes from a static array so it should be fine but let's see what Aaron says.

aaron.ballman accepted this revision.Apr 6 2023, 7:22 AM

LGTM! There shouldn't be any lifetime issues from this, as @shafik pointed out, the pointer originates in a static array defined in TokenKinds.cpp.

This revision is now accepted and ready to land.Apr 6 2023, 7:22 AM