This is an archive of the discontinued LLVM Phabricator instance.

(Trivial) TargetPassConfig: assert when TargetMachine has no MCAsmInfo
ClosedPublic

Authored by asb on Aug 12 2016, 3:30 AM.

Details

Summary

This is a pretty trivial, but I thought it was worth just checking that nobody feels it's completely the wrong thing to be doing.

The motivation is that when starting a new backend, you often start with a minimal stub, pretty much just FooTargetMachine and FooTargetInfo. Once that's built, you might naturally try llc -march=foo myinput.ll and it seems more developer-friendly if this ends up asserting due to the lack of MCAsmInfo with an informative message rather than just segfaulting.

Diff Detail

Repository
rL LLVM

Event Timeline

asb updated this revision to Diff 67813.Aug 12 2016, 3:30 AM
asb retitled this revision from to (Trivial) TargetPassConfig: assert when TargetMachine has no MCAsmInfo.
asb updated this object.
asb added reviewers: chandlerc, MatzeB.
asb added a subscriber: llvm-commits.
asb added a subscriber: bogner.Aug 17 2016, 12:36 AM

This patch got an LGTM from @bogner that for some strange reason wasn't registered by Phabricator even though the proper reply-to was used in the email.

chandlerc accepted this revision.Aug 17 2016, 12:46 AM
chandlerc edited edge metadata.

Marking it as accepted in PHab as well.

Did you need someone to commit it?

This revision is now accepted and ready to land.Aug 17 2016, 12:46 AM
asb closed this revision.Aug 18 2016, 6:16 AM
This revision was automatically updated to reflect the committed changes.