This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Replace assertion by error message while lowering RETURNADDR and FRAMEADDR
ClosedPublic

Authored by gonglingqin on Oct 27 2022, 11:36 PM.

Details

Summary

If __builtin_frame_address or __builtin_return_address is invoked with
non-zero argument, show an error message instead of a crash.

Reference: https://reviews.llvm.org/rG83b88441ad951fe99c30402930ef3cd661f2fd2b

Diff Detail

Event Timeline

gonglingqin created this revision.Oct 27 2022, 11:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 11:36 PM
gonglingqin requested review of this revision.Oct 27 2022, 11:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 11:36 PM
gonglingqin edited the summary of this revision. (Show Details)Oct 27 2022, 11:41 PM
xen0n accepted this revision.Oct 27 2022, 11:44 PM
This revision is now accepted and ready to land.Oct 27 2022, 11:44 PM
xen0n added inline comments.Oct 27 2022, 11:45 PM
llvm/test/CodeGen/LoongArch/frameaddr-returnaddr-error.ll
20

nit: "for the current frame"?

gonglingqin added inline comments.Oct 28 2022, 12:07 AM
llvm/test/CodeGen/LoongArch/frameaddr-returnaddr-error.ll
20

Thanks, I will modify it.

Address @xen0n's comments.