Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 1 | //===- SystemZConstantPoolValue.h - SystemZ constant-pool value -*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 10 | #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H |
| 11 | #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 12 | |
| 13 | #include "llvm/CodeGen/MachineConstantPool.h" |
| 14 | #include "llvm/Support/ErrorHandling.h" |
| 15 | |
| 16 | namespace llvm { |
| 17 | |
| 18 | class GlobalValue; |
| 19 | |
| 20 | namespace SystemZCP { |
Richard Sandiford | c231269 | 2014-03-06 10:38:30 +0000 | [diff] [blame] | 21 | enum SystemZCPModifier { |
Ulrich Weigand | 7db6918 | 2015-02-18 09:13:27 +0000 | [diff] [blame] | 22 | TLSGD, |
| 23 | TLSLDM, |
| 24 | DTPOFF, |
Richard Sandiford | c231269 | 2014-03-06 10:38:30 +0000 | [diff] [blame] | 25 | NTPOFF |
| 26 | }; |
| 27 | } // end namespace SystemZCP |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 28 | |
| 29 | /// A SystemZ-specific constant pool value. At present, the only |
Ulrich Weigand | 7db6918 | 2015-02-18 09:13:27 +0000 | [diff] [blame] | 30 | /// defined constant pool values are module IDs or offsets of |
| 31 | /// thread-local variables (written x@TLSGD, x@TLSLDM, x@DTPOFF, |
| 32 | /// or x@NTPOFF). |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 33 | class SystemZConstantPoolValue : public MachineConstantPoolValue { |
| 34 | const GlobalValue *GV; |
| 35 | SystemZCP::SystemZCPModifier Modifier; |
| 36 | |
| 37 | protected: |
| 38 | SystemZConstantPoolValue(const GlobalValue *GV, |
| 39 | SystemZCP::SystemZCPModifier Modifier); |
| 40 | |
| 41 | public: |
| 42 | static SystemZConstantPoolValue * |
| 43 | Create(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier); |
| 44 | |
| 45 | // Override MachineConstantPoolValue. |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 46 | int getExistingMachineCPValue(MachineConstantPool *CP, |
| 47 | unsigned Alignment) override; |
| 48 | void addSelectionDAGCSEId(FoldingSetNodeID &ID) override; |
| 49 | void print(raw_ostream &O) const override; |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 50 | |
| 51 | // Access SystemZ-specific fields. |
| 52 | const GlobalValue *getGlobalValue() const { return GV; } |
| 53 | SystemZCP::SystemZCPModifier getModifier() const { return Modifier; } |
| 54 | }; |
| 55 | |
Richard Sandiford | c231269 | 2014-03-06 10:38:30 +0000 | [diff] [blame] | 56 | } // end namespace llvm |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 57 | |
| 58 | #endif |