1251607Sdim//===- SystemZConstantPoolValue.h - SystemZ constant-pool value -*- C++ -*-===// 2251607Sdim// 3251607Sdim// The LLVM Compiler Infrastructure 4251607Sdim// 5251607Sdim// This file is distributed under the University of Illinois Open Source 6251607Sdim// License. See LICENSE.TXT for details. 7251607Sdim// 8251607Sdim//===----------------------------------------------------------------------===// 9251607Sdim 10251607Sdim#ifndef SYSTEMZCONSTANTPOOLVALUE_H 11251607Sdim#define SYSTEMZCONSTANTPOOLVALUE_H 12251607Sdim 13251607Sdim#include "llvm/CodeGen/MachineConstantPool.h" 14251607Sdim#include "llvm/Support/ErrorHandling.h" 15251607Sdim 16251607Sdimnamespace llvm { 17251607Sdim 18251607Sdimclass GlobalValue; 19251607Sdim 20251607Sdimnamespace SystemZCP { 21251607Sdim enum SystemZCPModifier { 22251607Sdim NTPOFF 23251607Sdim }; 24251607Sdim} 25251607Sdim 26251607Sdim/// A SystemZ-specific constant pool value. At present, the only 27251607Sdim/// defined constant pool values are offsets of thread-local variables 28251607Sdim/// (written x@NTPOFF). 29251607Sdimclass SystemZConstantPoolValue : public MachineConstantPoolValue { 30251607Sdim const GlobalValue *GV; 31251607Sdim SystemZCP::SystemZCPModifier Modifier; 32251607Sdim 33251607Sdimprotected: 34251607Sdim SystemZConstantPoolValue(const GlobalValue *GV, 35251607Sdim SystemZCP::SystemZCPModifier Modifier); 36251607Sdim 37251607Sdimpublic: 38251607Sdim static SystemZConstantPoolValue * 39251607Sdim Create(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier); 40251607Sdim 41251607Sdim // Override MachineConstantPoolValue. 42251607Sdim virtual unsigned getRelocationInfo() const LLVM_OVERRIDE; 43251607Sdim virtual int getExistingMachineCPValue(MachineConstantPool *CP, 44251607Sdim unsigned Alignment) LLVM_OVERRIDE; 45251607Sdim virtual void addSelectionDAGCSEId(FoldingSetNodeID &ID) LLVM_OVERRIDE; 46251607Sdim virtual void print(raw_ostream &O) const LLVM_OVERRIDE; 47251607Sdim 48251607Sdim // Access SystemZ-specific fields. 49251607Sdim const GlobalValue *getGlobalValue() const { return GV; } 50251607Sdim SystemZCP::SystemZCPModifier getModifier() const { return Modifier; } 51251607Sdim}; 52251607Sdim 53251607Sdim} // End llvm namespace 54251607Sdim 55251607Sdim#endif 56