[llvm] c7c70f2 - [JITLink] Add riscv.cpp

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 23 08:58:08 PDT 2021


Author: luxufan
Date: 2021-07-23T23:57:44+08:00
New Revision: c7c70f20a16e91e616be216ae2f3fd2586c1d30e

URL: https://github.com/llvm/llvm-project/commit/c7c70f20a16e91e616be216ae2f3fd2586c1d30e
DIFF: https://github.com/llvm/llvm-project/commit/c7c70f20a16e91e616be216ae2f3fd2586c1d30e.diff

LOG: [JITLink] Add riscv.cpp

Added: 
    llvm/lib/ExecutionEngine/JITLink/riscv.cpp

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/JITLink/riscv.cpp b/llvm/lib/ExecutionEngine/JITLink/riscv.cpp
new file mode 100644
index 000000000000..6b73ff95a3b0
--- /dev/null
+++ b/llvm/lib/ExecutionEngine/JITLink/riscv.cpp
@@ -0,0 +1,44 @@
+//===------ riscv.cpp - Generic JITLink riscv edge kinds, utilities -------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Generic utilities for graphs representing riscv objects.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ExecutionEngine/JITLink/riscv.h"
+
+#define DEBUG_TYPE "jitlink"
+
+namespace llvm {
+namespace jitlink {
+namespace riscv {
+
+const char *getEdgeKindName(Edge::Kind K) {
+  switch (K) {
+  case R_RISCV_32:
+    return "R_RISCV_32";
+  case R_RISCV_64:
+    return "R_RISCV_64";
+  case R_RISCV_HI20:
+    return "R_RISCV_HI20";
+  case R_RISCV_LO12_I:
+    return "R_RISCV_LO12_I";
+  case R_RISCV_PCREL_HI20:
+    return "R_RISCV_PCREL_HI20";
+  case R_RISCV_PCREL_LO12_I:
+    return "R_RISCV_PCREL_LO12_I";
+  case R_RISCV_PCREL_LO12_S:
+    return "R_RISCV_PCREL_LO12_S";
+  case R_RISCV_CALL:
+    return "R_RISCV_CALL";
+  }
+  return getGenericEdgeKindName(K);
+}
+} // namespace riscv
+} // namespace jitlink
+} // namespace llvm


        


More information about the llvm-commits mailing list