This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Add a -trap-unreachable option for debugging
ClosedPublic

Authored by dmgreen on Feb 6 2018, 7:06 AM.

Details

Summary

Add a common -trap-unreachable option, similar to the target
specific hexagon equivalent, which has been replaced. This
turns unreachable instructions into traps, which is useful for
debugging.

Diff Detail

Repository
rL LLVM

Event Timeline

dmgreen created this revision.Feb 6 2018, 7:06 AM

Would it be possible to enable this for all targets, not just ARM? Maybe this could be put into the constructor of LLVMTargetMachine?

dmgreen updated this revision to Diff 133002.Feb 6 2018, 7:48 AM
dmgreen retitled this revision from [ARM] Add an -arm-trap-unreachable for debugging to [CodeGen] Add a -trap-unreachable option for debugging.
dmgreen edited the summary of this revision. (Show Details)

Sounds like a good idea. Now for all targets. I have not removed the hexagon option, in case it was being used by them.

You can remove the Hexagon-specific option. It's used in one testcase, you can replace it with the one you introduced.

dmgreen updated this revision to Diff 133188.Feb 7 2018, 3:01 AM
dmgreen edited the summary of this revision. (Show Details)
dmgreen added a reviewer: kparzysz.
dmgreen removed a subscriber: kparzysz.

Thanks! Now removes the old option.

olista01 accepted this revision.Feb 7 2018, 5:39 AM

LGTM.

This revision is now accepted and ready to land.Feb 7 2018, 5:39 AM
This revision was automatically updated to reflect the committed changes.