[llvm] [RISCV] Support the large code model. (PR #70308)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 23:14:49 PDT 2024


================
@@ -0,0 +1,63 @@
+//===--- RISCVConstantPoolValue.h - RISC-V constantpool value ---*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the RISC-V specific constantpool value class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIB_TARGET_RISCV_RISCVCONSTANTPOOLVALUE_H
+#define LLVM_LIB_TARGET_RISCV_RISCVCONSTANTPOOLVALUE_H
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/CodeGen/MachineConstantPool.h"
+#include "llvm/Support/Casting.h"
+#include "llvm/Support/ErrorHandling.h"
+
+namespace llvm {
+
+class BlockAddress;
+class GlobalValue;
+class LLVMContext;
+
+/// A RISCV-specific constant pool value.
+class RISCVConstantPoolValue : public MachineConstantPoolValue {
+  const GlobalValue *GV;
+  const StringRef S;
+
+  RISCVConstantPoolValue(Type *Ty, const GlobalValue *GV);
+  RISCVConstantPoolValue(LLVMContext &C, StringRef s);
+
+private:
+  enum class RISCVCPKind { ExtSymbol, GlobalValue };
+  RISCVCPKind Kind;
+
+public:
+  ~RISCVConstantPoolValue() = default;
+
+  static RISCVConstantPoolValue *Create(const GlobalValue *GV);
+  static RISCVConstantPoolValue *Create(LLVMContext &C, StringRef s);
----------------
topperc wrote:

Capitalize `s`

https://github.com/llvm/llvm-project/pull/70308


More information about the llvm-commits mailing list