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";
30 return "R_RISCV_HI20";
32 return "R_RISCV_LO12_I";
33 case R_RISCV_PCREL_HI20:
34 return "R_RISCV_PCREL_HI20";
35 case R_RISCV_PCREL_LO12_I:
36 return "R_RISCV_PCREL_LO12_I";
37 case R_RISCV_PCREL_LO12_S:
38 return "R_RISCV_PCREL_LO12_S";
40 return "R_RISCV_CALL";
41 case R_RISCV_32_PCREL:
42 return "R_RISCV_32_PCREL";
44 return "R_RISCV_ADD64";
46 return "R_RISCV_ADD32";
48 return "R_RISCV_ADD16";
50 return "R_RISCV_ADD8";
52 return "R_RISCV_SUB64";
54 return "R_RISCV_SUB32";
56 return "R_RISCV_SUB16";
58 return "R_RISCV_SUB8";
60 return "R_RISCV_SET6";
62 return "R_RISCV_SET8";
64 return "R_RISCV_SET16";
66 return "R_RISCV_SET32";
68 return getGenericEdgeKindName(K);
71 } // namespace jitlink