aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYConstantPoolValue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/CSKY/CSKYConstantPoolValue.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Target/CSKY/CSKYConstantPoolValue.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYConstantPoolValue.cpp b/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYConstantPoolValue.cpp
index d4c4bb847237..7998f4c6de9c 100644
--- a/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYConstantPoolValue.cpp
+++ b/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYConstantPoolValue.cpp
@@ -77,16 +77,23 @@ void CSKYConstantPoolValue::print(raw_ostream &O) const {
//===----------------------------------------------------------------------===//
CSKYConstantPoolConstant::CSKYConstantPoolConstant(
- const Constant *C, CSKYCP::CSKYCPKind Kind, unsigned PCAdjust,
+ const Constant *C, Type *Ty, CSKYCP::CSKYCPKind Kind, unsigned PCAdjust,
CSKYCP::CSKYCPModifier Modifier, bool AddCurrentAddress, unsigned ID)
- : CSKYConstantPoolValue(C->getType(), Kind, PCAdjust, Modifier,
- AddCurrentAddress, ID),
+ : CSKYConstantPoolValue(Ty, Kind, PCAdjust, Modifier, AddCurrentAddress,
+ ID),
CVal(C) {}
CSKYConstantPoolConstant *CSKYConstantPoolConstant::Create(
const Constant *C, CSKYCP::CSKYCPKind Kind, unsigned PCAdjust,
CSKYCP::CSKYCPModifier Modifier, bool AddCurrentAddress, unsigned ID) {
- return new CSKYConstantPoolConstant(C, Kind, PCAdjust, Modifier,
+ return new CSKYConstantPoolConstant(C, C->getType(), Kind, PCAdjust, Modifier,
+ AddCurrentAddress, ID);
+}
+
+CSKYConstantPoolConstant *CSKYConstantPoolConstant::Create(
+ const Constant *C, Type *Ty, CSKYCP::CSKYCPKind Kind, unsigned PCAdjust,
+ CSKYCP::CSKYCPModifier Modifier, bool AddCurrentAddress, unsigned ID) {
+ return new CSKYConstantPoolConstant(C, Ty, Kind, PCAdjust, Modifier,
AddCurrentAddress, ID);
}
@@ -100,6 +107,10 @@ const BlockAddress *CSKYConstantPoolConstant::getBlockAddress() const {
return cast<BlockAddress>(CVal);
}
+const Constant *CSKYConstantPoolConstant::getConstantPool() const {
+ return CVal;
+}
+
int CSKYConstantPoolConstant::getExistingMachineCPValue(MachineConstantPool *CP,
Align Alignment) {
return getExistingMachineCPValueImpl<CSKYConstantPoolConstant>(CP, Alignment);