This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Add support for the full set of inline asm constraints
ClosedPublic

Authored by dylanmckay on Jan 4 2017, 10:17 PM.

Details

Summary

Previously the method would simply return false, causing every single
inline assembly constraint to trigger a compile error.

This adds inline assembly constraint support for the AVR target.

This patch is derived from the code in
AVRISelLowering::getConstraintType.

More details can be found on the AVR-GCC reference wiki
http://www.nongnu.org/avr-libc/user-manual/inline_asm.html

Diff Detail

Repository
rL LLVM

Event Timeline

dylanmckay updated this revision to Diff 83194.Jan 4 2017, 10:17 PM
dylanmckay retitled this revision from to [AVR] Add support for the full set of inline asm constraints.
dylanmckay updated this object.
dylanmckay added a reviewer: jroelofs.
dylanmckay added subscribers: cfe-commits, saaadhu.

Test case?

lib/Basic/Targets.cpp
8506 ↗(On Diff #83194)

Is this meant to fall through or do you need a "break" here?

dylanmckay updated this revision to Diff 83504.Jan 6 2017, 9:13 PM

Fix a few cases of unintentional switch fallthrough

dylanmckay updated this revision to Diff 83507.Jan 6 2017, 9:41 PM

Add tests for inline assembly constraints

dylanmckay marked an inline comment as done.Jan 6 2017, 9:42 PM
dylanmckay added inline comments.
lib/Basic/Targets.cpp
8506 ↗(On Diff #83194)

Nice catch, fixed

dylanmckay marked an inline comment as done.Feb 3 2017, 5:11 PM

Ping

dylanmckay marked an inline comment as done.Feb 3 2017, 5:12 PM

Ping

asl added a subscriber: asl.Feb 4 2017, 1:15 PM
asl added inline comments.
test/CodeGen/avr-inline-asm-constraints.c
2 ↗(On Diff #83507)

You need checks for multi-character stuff and unsupported constraints.

dylanmckay updated this revision to Diff 87190.Feb 5 2017, 11:59 PM
dylanmckay marked an inline comment as done.

Add tests

  • Add multichar constraint tests
  • Add 'unsupported constraint' tests
dylanmckay updated this revision to Diff 87191.Feb 5 2017, 11:59 PM
dylanmckay removed a reviewer: asl.

Add tests

  • Add multichar constraint tests
  • Add 'unsupported constraint' tests
asl accepted this revision.Feb 6 2017, 12:57 AM
asl added inline comments.
lib/Basic/Targets.cpp
8570 ↗(On Diff #87191)

don't you want to have "return false" here, just to silence warning for some compilers?

This revision is now accepted and ready to land.Feb 6 2017, 12:57 AM
This revision was automatically updated to reflect the committed changes.