1 //===- SystemZConstantPoolValue.h - SystemZ constant-pool value -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
11 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
13 #include "llvm/CodeGen/MachineConstantPool.h"
14 #include "llvm/Support/ErrorHandling.h"
21 enum SystemZCPModifier
{
27 } // end namespace SystemZCP
29 /// A SystemZ-specific constant pool value. At present, the only
30 /// defined constant pool values are module IDs or offsets of
31 /// thread-local variables (written x@TLSGD, x@TLSLDM, x@DTPOFF,
33 class SystemZConstantPoolValue
: public MachineConstantPoolValue
{
34 const GlobalValue
*GV
;
35 SystemZCP::SystemZCPModifier Modifier
;
38 SystemZConstantPoolValue(const GlobalValue
*GV
,
39 SystemZCP::SystemZCPModifier Modifier
);
42 static SystemZConstantPoolValue
*
43 Create(const GlobalValue
*GV
, SystemZCP::SystemZCPModifier Modifier
);
45 // Override MachineConstantPoolValue.
46 int getExistingMachineCPValue(MachineConstantPool
*CP
,
47 unsigned Alignment
) override
;
48 void addSelectionDAGCSEId(FoldingSetNodeID
&ID
) override
;
49 void print(raw_ostream
&O
) const override
;
51 // Access SystemZ-specific fields.
52 const GlobalValue
*getGlobalValue() const { return GV
; }
53 SystemZCP::SystemZCPModifier
getModifier() const { return Modifier
; }
56 } // end namespace llvm