Fix uninitialized variable
[llvm-core.git] / lib / Target / Nios2 / Nios2Subtarget.h
bloba822dff33b5b1a1f1d50371864da02da6d07701e
1 //===-- Nios2Subtarget.h - Define Subtarget for the Nios2 -------*- 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 Nios2 specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_NIOS2_NIOS2SUBTARGET_H
15 #define LLVM_LIB_TARGET_NIOS2_NIOS2SUBTARGET_H
17 #include "Nios2FrameLowering.h"
18 #include "Nios2ISelLowering.h"
19 #include "Nios2InstrInfo.h"
20 #include "llvm/CodeGen/SelectionDAGTargetInfo.h"
21 #include "llvm/CodeGen/TargetFrameLowering.h"
22 #include "llvm/CodeGen/TargetSubtargetInfo.h"
24 #define GET_SUBTARGETINFO_HEADER
25 #include "Nios2GenSubtargetInfo.inc"
27 namespace llvm {
28 class StringRef;
30 class Nios2TargetMachine;
32 class Nios2Subtarget : public Nios2GenSubtargetInfo {
33 virtual void anchor();
35 public:
36 // Nios2 R2 features
37 // Bit manipulation instructions extension
38 bool HasBMX;
39 // Code Density instructions extension
40 bool HasCDX;
41 // Multi-Processor instructions extension
42 bool HasMPX;
43 // New mandatory instructions
44 bool HasR2Mandatory;
46 protected:
47 enum Nios2ArchEnum {
48 // Nios2 R1 ISA
49 Nios2r1,
50 // Nios2 R2 ISA
51 Nios2r2
54 // Nios2 architecture version
55 Nios2ArchEnum Nios2ArchVersion;
57 Triple TargetTriple;
59 Nios2InstrInfo InstrInfo;
60 Nios2TargetLowering TLInfo;
61 SelectionDAGTargetInfo TSInfo;
62 Nios2FrameLowering FrameLowering;
64 public:
65 /// This constructor initializes the data members to match that
66 /// of the specified triple.
67 Nios2Subtarget(const Triple &TT, const std::string &CPU,
68 const std::string &FS, const TargetMachine &TM);
70 /// ParseSubtargetFeatures - Parses features string setting specified
71 /// subtarget options. Definition of function is auto generated by tblgen.
72 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
74 bool hasNios2r1() const { return Nios2ArchVersion >= Nios2r1; }
75 bool isNios2r1() const { return Nios2ArchVersion == Nios2r1; }
76 bool hasNios2r2() const { return Nios2ArchVersion >= Nios2r2; }
77 bool isNios2r2() const { return Nios2ArchVersion == Nios2r2; }
79 Nios2Subtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
81 const Nios2InstrInfo *getInstrInfo() const override { return &InstrInfo; }
82 const TargetFrameLowering *getFrameLowering() const override {
83 return &FrameLowering;
85 const Nios2RegisterInfo *getRegisterInfo() const override {
86 return &InstrInfo.getRegisterInfo();
88 const Nios2TargetLowering *getTargetLowering() const override {
89 return &TLInfo;
91 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
92 return &TSInfo;
95 } // namespace llvm
97 #endif