LLVM API Documentation

SystemZConstantPoolValue.h
Go to the documentation of this file.
00001 //===- SystemZConstantPoolValue.h - SystemZ constant-pool value -*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
00011 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
00012 
00013 #include "llvm/CodeGen/MachineConstantPool.h"
00014 #include "llvm/Support/ErrorHandling.h"
00015 
00016 namespace llvm {
00017 
00018 class GlobalValue;
00019 
00020 namespace SystemZCP {
00021 enum SystemZCPModifier {
00022   NTPOFF
00023 };
00024 } // end namespace SystemZCP
00025 
00026 /// A SystemZ-specific constant pool value.  At present, the only
00027 /// defined constant pool values are offsets of thread-local variables
00028 /// (written x@NTPOFF).
00029 class SystemZConstantPoolValue : public MachineConstantPoolValue {
00030   const GlobalValue *GV;
00031   SystemZCP::SystemZCPModifier Modifier;
00032 
00033 protected:
00034   SystemZConstantPoolValue(const GlobalValue *GV,
00035                            SystemZCP::SystemZCPModifier Modifier);
00036 
00037 public:
00038   static SystemZConstantPoolValue *
00039     Create(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier);
00040 
00041   // Override MachineConstantPoolValue.
00042   unsigned getRelocationInfo() const override;
00043   int getExistingMachineCPValue(MachineConstantPool *CP,
00044                                 unsigned Alignment) override;
00045   void addSelectionDAGCSEId(FoldingSetNodeID &ID) override;
00046   void print(raw_ostream &O) const override;
00047 
00048   // Access SystemZ-specific fields.
00049   const GlobalValue *getGlobalValue() const { return GV; }
00050   SystemZCP::SystemZCPModifier getModifier() const { return Modifier; }
00051 };
00052 
00053 } // end namespace llvm
00054 
00055 #endif