riscv.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //===------ riscv.cpp - Generic JITLink riscv edge kinds, utilities -------===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // Generic utilities for graphs representing riscv objects.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #include "llvm/ExecutionEngine/JITLink/riscv.h"
  13. #define DEBUG_TYPE "jitlink"
  14. namespace llvm {
  15. namespace jitlink {
  16. namespace riscv {
  17. const char *getEdgeKindName(Edge::Kind K) {
  18. switch (K) {
  19. case R_RISCV_32:
  20. return "R_RISCV_32";
  21. case R_RISCV_64:
  22. return "R_RISCV_64";
  23. case R_RISCV_BRANCH:
  24. return "R_RISCV_BRANCH";
  25. case R_RISCV_HI20:
  26. return "R_RISCV_HI20";
  27. case R_RISCV_LO12_I:
  28. return "R_RISCV_LO12_I";
  29. case R_RISCV_PCREL_HI20:
  30. return "R_RISCV_PCREL_HI20";
  31. case R_RISCV_PCREL_LO12_I:
  32. return "R_RISCV_PCREL_LO12_I";
  33. case R_RISCV_PCREL_LO12_S:
  34. return "R_RISCV_PCREL_LO12_S";
  35. case R_RISCV_CALL:
  36. return "R_RISCV_CALL";
  37. case R_RISCV_32_PCREL:
  38. return "R_RISCV_32_PCREL";
  39. case R_RISCV_ADD64:
  40. return "R_RISCV_ADD64";
  41. case R_RISCV_ADD32:
  42. return "R_RISCV_ADD32";
  43. case R_RISCV_ADD16:
  44. return "R_RISCV_ADD16";
  45. case R_RISCV_ADD8:
  46. return "R_RISCV_ADD8";
  47. case R_RISCV_SUB64:
  48. return "R_RISCV_SUB64";
  49. case R_RISCV_SUB32:
  50. return "R_RISCV_SUB32";
  51. case R_RISCV_SUB16:
  52. return "R_RISCV_SUB16";
  53. case R_RISCV_SUB8:
  54. return "R_RISCV_SUB8";
  55. case R_RISCV_SET6:
  56. return "R_RISCV_SET6";
  57. case R_RISCV_SET8:
  58. return "R_RISCV_SET8";
  59. case R_RISCV_SET16:
  60. return "R_RISCV_SET16";
  61. case R_RISCV_SET32:
  62. return "R_RISCV_SET32";
  63. }
  64. return getGenericEdgeKindName(K);
  65. }
  66. } // namespace riscv
  67. } // namespace jitlink
  68. } // namespace llvm