This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Don't crash when printing static enum members with bool as underlying type
ClosedPublic

Authored by aeubanks on Oct 30 2022, 12:45 PM.

Details

Summary

Undoes a lot of the code added in D135169 to piggyback off of the enum logic in TypeSystemClang::SetIntegerInitializerForVariable().

Fixes #58383.

Diff Detail

Event Timeline

aeubanks created this revision.Oct 30 2022, 12:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 30 2022, 12:45 PM
aeubanks requested review of this revision.Oct 30 2022, 12:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 30 2022, 12:45 PM
DavidSpickett added inline comments.Oct 31 2022, 3:22 AM
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
7612

Can you call TypeSystemClang::IsBooleanType from here instead?

aeubanks updated this revision to Diff 472053.Oct 31 2022, 10:17 AM

undo a lot of code added in D135169. it seems a little overengineered when we can just check if the type is bool when setting the initializer.

aeubanks added inline comments.Oct 31 2022, 10:21 AM
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
7612

better?

aeubanks updated this revision to Diff 472061.Oct 31 2022, 10:34 AM

capitalize comment

aeubanks edited the summary of this revision. (Show Details)Oct 31 2022, 12:22 PM
DavidSpickett accepted this revision.Nov 1 2022, 2:10 AM

LGTM

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
7612

Much!

This revision is now accepted and ready to land.Nov 1 2022, 2:10 AM