1//===- SystemZConstantPoolValue.h - SystemZ constant-pool value -*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
10#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
11
12#include "llvm/CodeGen/MachineConstantPool.h"
13#include "llvm/Support/ErrorHandling.h"
14
15namespace llvm {
16
17class GlobalValue;
18
19namespace SystemZCP {
20enum SystemZCPModifier {
21 TLSGD,
22 TLSLDM,
23 DTPOFF,
24 NTPOFF
25};
26} // end namespace SystemZCP
27
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,
31/// or x@NTPOFF).
32class SystemZConstantPoolValue : public MachineConstantPoolValue {
33 const GlobalValue *GV;
34 SystemZCP::SystemZCPModifier Modifier;
35
36protected:
37 SystemZConstantPoolValue(const GlobalValue *GV,
38 SystemZCP::SystemZCPModifier Modifier);
39
40public:
41 static SystemZConstantPoolValue *
42 Create(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier);
43
44 // Override MachineConstantPoolValue.
45 int getExistingMachineCPValue(MachineConstantPool *CP,
46 Align Alignment) override;
47 void addSelectionDAGCSEId(FoldingSetNodeID &ID) override;
48 void print(raw_ostream &O) const override;
49
50 // Access SystemZ-specific fields.
51 const GlobalValue *getGlobalValue() const { return GV; }
52 SystemZCP::SystemZCPModifier getModifier() const { return Modifier; }
53};
54
55} // end namespace llvm
56
57#endif
58

source code of llvm/lib/Target/SystemZ/SystemZConstantPoolValue.h