This adds the AVR machine code backend (AVRAsmBackend.cpp). This will
allow us to generate machine code from assembled AVR instructions.
Details
Diff Detail
- Build Status
Buildable 107 Build 107: arc lint + arc unit
Event Timeline
lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp | ||
---|---|---|
39 | Is T ever anything other than uint64_t? Do you really need all these templates? | |
251 | Can Ctx ever be null? You are getting it from MCAssembler that has it as a member, so it will always be there. Unless you anticipate that it won't always be available (e.g. you will call this function from another place), you could make Ctx a reference. |
lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp | ||
---|---|---|
39 | I plan on moving these under a common header so that it can be shared between the AsmBackend and the LLVM linker. Seems good form to not force either user to use uint64_t, but I'm happy to remove the templates if you still think they should go. | |
251 | We normally get the MCContext from MCAssembler but not always. When using -show-encoding with llvm-mc, fixups are adjusted but there is no accompanied MCContext, in which case we have to handle it being null. |
Code review from Krzystof
- Fixed encoding of 'call' fixup
- Collapsed template into uint64_t
lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp | ||
---|---|---|
115 | It looks like that top value was completely wrong - we were duplicating the lower 4 bits and moving it to the top. I have fixed this up so we instead grab the top 4 bits and shift it into the correct position. |
Is T ever anything other than uint64_t? Do you really need all these templates?