8 Commits

Author SHA1 Message Date
Alex Bradbury afea6f4cd3 [RISCV] Bugfix createRISCVELFObjectWriter
r315275 set the IsLittleEndian parameter incorrectly. This patch corrects 
this, and adds a test to ensure such mistakes will be caught in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316091 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 16:11:31 +00:00
Alex Bradbury 804feefa21 [RISCV] Fix build after r315327
Differential Revision: https://reviews.llvm.org/D38779
Patch by Chih-Mao Chen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315455 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11 12:09:06 +00:00
Alex Bradbury b59966146a [RISCV] Fix build after r315254
createELFObjectWriter now takes a std::unique_ptr<MCELFObjectTargetWriter> 
rather than a MCELFObjectTargetWriter*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315275 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10 07:19:18 +00:00
Alex Bradbury 5f9771e742 [RISCV] Add common fixups and relocations
%lo(), %hi(), and %pcrel_hi() are supported and test cases have been added to 
ensure the appropriate fixups and relocations are generated. I've added an 
instruction format field which is used in RISCVMCCodeEmitter to, for 
instance, tell whether it should emit a lo12_i fixup or a lo12_s fixup 
(RISC-V has two 12-bit immediate encodings depending on the instruction 
type).

Differential Revision: https://reviews.llvm.org/D23568


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314389 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-28 08:26:24 +00:00
Alex Bradbury 5f1fa48a24 [RISCV] Fix two abuses of llvm_unreachable
Replace with report_fatal_error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311276 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20 06:57:27 +00:00
Alex Bradbury cc0899c732 [RISCV] Set HasRelocationAddend for RISCVELFObjectWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311275 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20 06:55:14 +00:00
Aaron Ballman 41b84edffa Removing a switch statement that contains a default label, but no case labels. Silences an MSVC warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 13:58:57 +00:00
Alex Bradbury 5ded6ebfad [RISCV] Add bare-bones RISC-V MCTargetDesc
This is enough to compile and link but doesn't yet do anything particularly 
useful. Once an ASM parser and printer are added in the next two patches, the 
whole thing can be usefully tested.

Differential Revision: https://reviews.llvm.org/D23562


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 23:47:30 +00:00