This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Move RISCVELFStreamer::getRelocPairForSize to RISCVFixUpKinds.h and reuse it. NFC
ClosedPublic

Authored by craig.topper on Jan 30 2023, 11:02 PM.

Details

Summary

Reuse it for RISCVAsmBackend.cpp.
While there make the function return a pair of MCFixupKind to
remove static_casts elsewhere.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 30 2023, 11:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 30 2023, 11:02 PM
craig.topper requested review of this revision.Jan 30 2023, 11:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 30 2023, 11:02 PM
asb added inline comments.Jan 31 2023, 2:10 AM
llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h
113

I get compile errors due to missing std::pair and std::make_pair. It looks like you need to add #include <utility> to this file.

reames accepted this revision.Jan 31 2023, 7:24 AM

LGTM once @asb 's comment is addressed.

This revision is now accepted and ready to land.Jan 31 2023, 7:24 AM
This revision was landed with ongoing or failed builds.Jan 31 2023, 1:14 PM
This revision was automatically updated to reflect the committed changes.