This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Migrate to new MCAsmBackend applyFixup
ClosedPublic

Authored by xiangzhai on Apr 10 2017, 1:30 AM.

Details

Summary

Hi LLVM developers,

MCAsmBackend added a new parameter MCContext &Ctx for applyFixup, so I just simply migrate it for AVR, please review my patch, thanks a lot!

BG: I am a Arduino fans, ported laserkbd to Linux :) and Thanks for Dylan McKay's great job: avr-llvm I will try it on my UNO v3.0 board :)

Regards,
Leslie Zhai

Diff Detail

Repository
rL LLVM

Event Timeline

xiangzhai created this revision.Apr 10 2017, 1:30 AM
jroelofs accepted this revision.Apr 10 2017, 11:09 AM

Why didn't the lack of this break the build?

This revision is now accepted and ready to land.Apr 10 2017, 11:09 AM

Hi Jonathan,

Thanks for your review!

Why didn't the lack of this break the build?

In file included from /data/project/LLVM/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp:14:
/data/project/LLVM/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h:44:55: error: non-virtual member function marked 'override' hides virtual member function

uint64_t Value, bool IsPCRel) const override;
                                    ^

/data/project/LLVM/llvm/include/llvm/MC/MCAsmBackend.h:76:16: note: hidden overloaded virtual function 'llvm::MCAsmBackend::applyFixup' declared here: different number of parameters (6 vs 5)

virtual void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize,
             ^

/data/project/LLVM/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp:469:14: error: allocating an object of abstract class type 'llvm::AVRAsmBackend'

return new AVRAsmBackend(TT.getOS());
           ^

/data/project/LLVM/llvm/include/llvm/MC/MCAsmBackend.h:76:16: note: unimplemented pure virtual method 'applyFixup' in 'AVRAsmBackend'

virtual void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize,
             ^

2 errors generated.

And I do not have commit access, please commit it on my behalf, thanks a lot!

Regards,
Leslie Zhai

jroelofs closed this revision.Apr 11 2017, 8:04 AM

r299946