LLVM  4.0.0
MipsTargetMachine.h
Go to the documentation of this file.
1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -----*- 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 Mips specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H
16 
18 #include "MipsSubtarget.h"
20 #include "llvm/CodeGen/Passes.h"
24 
25 namespace llvm {
26 class formatted_raw_ostream;
27 class MipsRegisterInfo;
28 
30  bool isLittle;
31  std::unique_ptr<TargetLoweringObjectFile> TLOF;
32  // Selected ABI
33  MipsABIInfo ABI;
34  MipsSubtarget *Subtarget;
35  MipsSubtarget DefaultSubtarget;
36  MipsSubtarget NoMips16Subtarget;
37  MipsSubtarget Mips16Subtarget;
38 
39  mutable StringMap<std::unique_ptr<MipsSubtarget>> SubtargetMap;
40 
41 public:
42  MipsTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
43  StringRef FS, const TargetOptions &Options,
45  CodeGenOpt::Level OL, bool isLittle);
46  ~MipsTargetMachine() override;
47 
49 
51  if (Subtarget)
52  return Subtarget;
53  return &DefaultSubtarget;
54  }
55 
56  const MipsSubtarget *getSubtargetImpl(const Function &F) const override;
57 
58  /// \brief Reset the subtarget for the Mips target.
60 
61  // Pass Pipeline Configuration
62  TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
63 
65  return TLOF.get();
66  }
67 
68  bool isLittleEndian() const { return isLittle; }
69  const MipsABIInfo &getABI() const { return ABI; }
70 };
71 
72 /// Mips32/64 big endian target machine.
73 ///
75  virtual void anchor();
76 public:
77  MipsebTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
78  StringRef FS, const TargetOptions &Options,
81 };
82 
83 /// Mips32/64 little endian target machine.
84 ///
86  virtual void anchor();
87 public:
88  MipselTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
89  StringRef FS, const TargetOptions &Options,
92 };
93 
94 } // End llvm namespace
95 
96 #endif
Analysis pass providing the TargetTransformInfo.
void resetSubtarget(MachineFunction *MF)
Reset the subtarget for the Mips target.
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
const MipsABIInfo & getABI() const
Target-Independent Code Generator Pass Configuration Options.
#define F(x, y, z)
Definition: MD5.cpp:51
MipsebTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
This class describes a target machine that is implemented with the LLVM target-independent code gener...
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
TargetLoweringObjectFile * getObjFileLowering() const override
Mips32/64 big endian target machine.
TargetIRAnalysis getTargetIRAnalysis() override
Get a TargetIRAnalysis implementation for the target.
Mips32/64 little endian target machine.
MipselTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Definition: StringMap.h:223
Target - Wrapper for Target specific information.
const MipsSubtarget * getSubtargetImpl() const
MipsTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47