This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Replace unneeded use of Foundation with ObjectiveC in tests (NFC)
ClosedPublic

Authored by kastiglione on Apr 4 2021, 2:58 PM.

Details

Summary

When referencing NSObject, it's enough to import objc/NSObject.h. Importing Foundation is unnecessary in these cases.

Diff Detail

Event Timeline

kastiglione requested review of this revision.Apr 4 2021, 2:58 PM
kastiglione created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2021, 2:58 PM
teemperor accepted this revision.Apr 4 2021, 3:11 PM

Thanks for cleaning this up!

lldb/test/API/commands/frame/recognizer/main.m
1

I guess this could also be just stdio.h (FWIW, the printfs in tests can also be removed as they just require including system headers and are essentially never useful).

This revision is now accepted and ready to land.Apr 4 2021, 3:11 PM
teemperor added inline comments.Apr 4 2021, 3:14 PM
lldb/test/API/commands/frame/recognizer/main.m
1

Just to be clear: I'm just saying that removing printfs and everything else that references system headers is usually always a good idea but I'm not asking that you should remove them here too. The stdio.h is perfect for this patch.

fix lldb/test/API/commands/frame/recognizer/main.m

kastiglione added inline comments.Apr 4 2021, 4:09 PM
lldb/test/API/commands/frame/recognizer/main.m
1

thanks for reviewing closely, a bunch of these changes were automated and I am guilty of not looking closely (if the test passed then I didn't look closer)

teemperor added inline comments.Apr 5 2021, 9:50 AM
lldb/test/API/commands/frame/recognizer/main.m
1

I was actually just looking if we had a "check that we didn't load a type from Foundation"-kind of test (as that was the only thing that I could see this could break