1 //===- SystemZConstantPoolValue.h - SystemZ constant-pool value -*- C++ -*-===//
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 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
10 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
12 #include "llvm/CodeGen/MachineConstantPool.h"
13 #include "llvm/Support/ErrorHandling.h"
20 enum SystemZCPModifier
{
26 } // end namespace SystemZCP
28 /// A SystemZ-specific constant pool value. At present, the only
29 /// defined constant pool values are module IDs or offsets of
30 /// thread-local variables (written x@TLSGD, x@TLSLDM, x@DTPOFF,
32 class SystemZConstantPoolValue
: public MachineConstantPoolValue
{
33 const GlobalValue
*GV
;
34 SystemZCP::SystemZCPModifier Modifier
;
37 SystemZConstantPoolValue(const GlobalValue
*GV
,
38 SystemZCP::SystemZCPModifier Modifier
);
41 static SystemZConstantPoolValue
*
42 Create(const GlobalValue
*GV
, SystemZCP::SystemZCPModifier Modifier
);
44 // Override MachineConstantPoolValue.
45 int getExistingMachineCPValue(MachineConstantPool
*CP
,
46 unsigned Alignment
) override
;
47 void addSelectionDAGCSEId(FoldingSetNodeID
&ID
) override
;
48 void print(raw_ostream
&O
) const override
;
50 // Access SystemZ-specific fields.
51 const GlobalValue
*getGlobalValue() const { return GV
; }
52 SystemZCP::SystemZCPModifier
getModifier() const { return Modifier
; }
55 } // end namespace llvm