SystemZSubtarget.h revision eddfaad1ef9a208a8a9ee23c26fac4d980caa99a
1//===-- SystemZSubtarget.h - SystemZ subtarget information -----*- 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//
10// This file declares the SystemZ specific subclass of TargetSubtargetInfo.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef SYSTEMZSUBTARGET_H
15#define SYSTEMZSUBTARGET_H
16
17#include "llvm/ADT/Triple.h"
18#include "llvm/Target/TargetSubtargetInfo.h"
19#include <string>
20
21#define GET_SUBTARGETINFO_HEADER
22#include "SystemZGenSubtargetInfo.inc"
23
24namespace llvm {
25class GlobalValue;
26class StringRef;
27
28class SystemZSubtarget : public SystemZGenSubtargetInfo {
29protected:
30  bool HasDistinctOps;
31
32private:
33  Triple TargetTriple;
34
35public:
36  SystemZSubtarget(const std::string &TT, const std::string &CPU,
37                   const std::string &FS);
38
39  // Automatically generated by tblgen.
40  void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
41
42  // Return true if the target has the distinct-operands facility.
43  bool hasDistinctOps() const { return HasDistinctOps; }
44
45  // Return true if GV can be accessed using LARL for reloc model RM
46  // and code model CM.
47  bool isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM,
48                       CodeModel::Model CM) const;
49
50  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
51};
52} // end namespace llvm
53
54#endif
55