2013-05-07 00:15:19 +08:00
|
|
|
//===- SystemZConstantPoolValue.h - SystemZ constant-pool value -*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
|
|
|
|
#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCONSTANTPOOLVALUE_H
|
2013-05-07 00:15:19 +08:00
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineConstantPool.h"
|
|
|
|
#include "llvm/Support/ErrorHandling.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class GlobalValue;
|
|
|
|
|
|
|
|
namespace SystemZCP {
|
2014-03-06 18:38:30 +08:00
|
|
|
enum SystemZCPModifier {
|
2015-02-18 17:13:27 +08:00
|
|
|
TLSGD,
|
|
|
|
TLSLDM,
|
|
|
|
DTPOFF,
|
2014-03-06 18:38:30 +08:00
|
|
|
NTPOFF
|
|
|
|
};
|
|
|
|
} // end namespace SystemZCP
|
2013-05-07 00:15:19 +08:00
|
|
|
|
|
|
|
/// A SystemZ-specific constant pool value. At present, the only
|
2015-02-18 17:13:27 +08:00
|
|
|
/// defined constant pool values are module IDs or offsets of
|
|
|
|
/// thread-local variables (written x@TLSGD, x@TLSLDM, x@DTPOFF,
|
|
|
|
/// or x@NTPOFF).
|
2013-05-07 00:15:19 +08:00
|
|
|
class SystemZConstantPoolValue : public MachineConstantPoolValue {
|
|
|
|
const GlobalValue *GV;
|
|
|
|
SystemZCP::SystemZCPModifier Modifier;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
SystemZConstantPoolValue(const GlobalValue *GV,
|
|
|
|
SystemZCP::SystemZCPModifier Modifier);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static SystemZConstantPoolValue *
|
|
|
|
Create(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier);
|
|
|
|
|
|
|
|
// Override MachineConstantPoolValue.
|
2014-03-06 20:03:36 +08:00
|
|
|
int getExistingMachineCPValue(MachineConstantPool *CP,
|
|
|
|
unsigned Alignment) override;
|
|
|
|
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override;
|
|
|
|
void print(raw_ostream &O) const override;
|
2013-05-07 00:15:19 +08:00
|
|
|
|
|
|
|
// Access SystemZ-specific fields.
|
|
|
|
const GlobalValue *getGlobalValue() const { return GV; }
|
|
|
|
SystemZCP::SystemZCPModifier getModifier() const { return Modifier; }
|
|
|
|
};
|
|
|
|
|
2014-03-06 18:38:30 +08:00
|
|
|
} // end namespace llvm
|
2013-05-07 00:15:19 +08:00
|
|
|
|
|
|
|
#endif
|