This is an archive of the discontinued LLVM Phabricator instance.

[AIX] Don't crash on unimplemented lowerRelativeReference
ClosedPublic

Authored by jsji on Aug 10 2021, 8:07 AM.

Details

Summary

We may call lowerRelativeReference in MC to determine whether target
supports this lowering. We should return nullptr instead of crashing
when we haven't implemented the real lowering.

Diff Detail

Event Timeline

jsji created this revision.Aug 10 2021, 8:07 AM
jsji requested review of this revision.Aug 10 2021, 8:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2021, 8:07 AM

Yes, it looks like the default implementation in the base class just returns nullptr and some other implementations reach points where they return nullptr. LGTM; thanks.

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
2459–2460

Minor nit: formatting.

This revision is now accepted and ready to land.Aug 10 2021, 8:23 AM
jsji updated this revision to Diff 365485.Aug 10 2021, 8:26 AM

Format comments.

We should add a test case for this. It would be good to verify that the caller does the right thing when we return a nullptr here.

jsji updated this revision to Diff 365515.Aug 10 2021, 9:40 AM

Add reduced testcase.

This revision was automatically updated to reflect the committed changes.