This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Support .reloc directive
ClosedPublic

Authored by MaskRay on Jan 6 2023, 7:15 PM.

Diff Detail

Event Timeline

MaskRay created this revision.Jan 6 2023, 7:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 7:15 PM
MaskRay requested review of this revision.Jan 6 2023, 7:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 7:15 PM
benshi001 added inline comments.Jan 7 2023, 7:12 AM
llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
425

Two suggestions:

  1. Put this after the
const static MCFixupKindInfo Infos[AVR::NumTargetFixupKinds]

and before

if (Kind < FirstTargetFixupKind)
  return MCAsmBackend::getFixupKindInfo(Kind);

this code style is common among ARM, AArch64, and RISCV.

  1. Add a comment line before, like
// Fixup kinds from .reloc directive are like R_AVR_NONE. They do not require
// any extra processing.

I also see the comment is common in other targets.

benshi001 added inline comments.Jan 7 2023, 7:21 AM
llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
256

In other targets, I see the piece of code is put in ::applyFixup and right before calling ::adjustFixupValue.

MaskRay updated this revision to Diff 487117.Jan 7 2023, 12:00 PM
MaskRay marked 2 inline comments as done.

comments

benshi001 accepted this revision.Jan 7 2023, 5:38 PM

LGTM. Thanks!

This revision is now accepted and ready to land.Jan 7 2023, 5:38 PM
This revision was automatically updated to reflect the committed changes.