1 //===------ riscv.cpp - Generic JITLink riscv edge kinds, utilities -------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Generic utilities for graphs representing riscv objects.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/ExecutionEngine/JITLink/riscv.h"
15 #define DEBUG_TYPE "jitlink"
21 const char *getEdgeKindName(Edge::Kind K
) {
28 return "R_RISCV_BRANCH";
32 return "R_RISCV_CALL";
33 case R_RISCV_CALL_PLT
:
34 return "R_RISCV_CALL_PLT";
35 case R_RISCV_GOT_HI20
:
36 return "R_RISCV_GOT_HI20";
37 case R_RISCV_PCREL_HI20
:
38 return "R_RISCV_PCREL_HI20";
39 case R_RISCV_PCREL_LO12_I
:
40 return "R_RISCV_PCREL_LO12_I";
41 case R_RISCV_PCREL_LO12_S
:
42 return "R_RISCV_PCREL_LO12_S";
44 return "R_RISCV_HI20";
46 return "R_RISCV_LO12_I";
48 return "R_RISCV_LO12_S";
50 return "R_RISCV_ADD8";
52 return "R_RISCV_ADD16";
54 return "R_RISCV_ADD32";
56 return "R_RISCV_ADD64";
58 return "R_RISCV_SUB8";
60 return "R_RISCV_SUB16";
62 return "R_RISCV_SUB32";
64 return "R_RISCV_SUB64";
65 case R_RISCV_RVC_BRANCH
:
66 return "R_RISCV_RVC_BRANCH";
67 case R_RISCV_RVC_JUMP
:
68 return "R_RISCV_RVC_JUMP";
70 return "R_RISCV_SUB6";
72 return "R_RISCV_SET6";
74 return "R_RISCV_SET8";
76 return "R_RISCV_SET16";
78 return "R_RISCV_SET32";
79 case R_RISCV_32_PCREL
:
80 return "R_RISCV_32_PCREL";
82 return "CallRelaxable";
84 return "AlignRelaxable";
88 return getGenericEdgeKindName(K
);
91 } // namespace jitlink