LLVM  8.0.1
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"
19 #include "llvm/ADT/Optional.h"
20 #include "llvm/ADT/StringMap.h"
21 #include "llvm/ADT/StringRef.h"
22 #include "llvm/Support/CodeGen.h"
24 #include <memory>
25 
26 namespace llvm {
27 
29  bool isLittle;
30  std::unique_ptr<TargetLoweringObjectFile> TLOF;
31  // Selected ABI
32  MipsABIInfo ABI;
33  MipsSubtarget *Subtarget;
34  MipsSubtarget DefaultSubtarget;
35  MipsSubtarget NoMips16Subtarget;
36  MipsSubtarget Mips16Subtarget;
37 
38  mutable StringMap<std::unique_ptr<MipsSubtarget>> SubtargetMap;
39 
40 public:
41  MipsTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
42  StringRef FS, const TargetOptions &Options,
44  CodeGenOpt::Level OL, bool JIT, bool isLittle);
45  ~MipsTargetMachine() override;
46 
48 
50  if (Subtarget)
51  return Subtarget;
52  return &DefaultSubtarget;
53  }
54 
55  const MipsSubtarget *getSubtargetImpl(const Function &F) const override;
56 
57  /// Reset the subtarget for the Mips target.
59 
60  // Pass Pipeline Configuration
62 
64  return TLOF.get();
65  }
66 
67  bool isLittleEndian() const { return isLittle; }
68  const MipsABIInfo &getABI() const { return ABI; }
69 
70  bool isMachineVerifierClean() const override {
71  return false;
72  }
73 };
74 
75 /// Mips32/64 big endian target machine.
76 ///
78  virtual void anchor();
79 
80 public:
81  MipsebTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
82  StringRef FS, const TargetOptions &Options,
84  CodeGenOpt::Level OL, bool JIT);
85 };
86 
87 /// Mips32/64 little endian target machine.
88 ///
90  virtual void anchor();
91 
92 public:
93  MipselTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
94  StringRef FS, const TargetOptions &Options,
96  CodeGenOpt::Level OL, bool JIT);
97 };
98 
99 } // end namespace llvm
100 
101 #endif // LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
void resetSubtarget(MachineFunction *MF)
Reset the subtarget for the Mips target.
F(f)
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
Target-Independent Code Generator Pass Configuration Options.
const MipsABIInfo & getABI() const
const MipsSubtarget * getSubtargetImpl() const
~MipsTargetMachine() override
This class describes a target machine that is implemented with the LLVM target-independent code gener...
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
TargetLoweringObjectFile * getObjFileLowering() const override
Mips32/64 big endian target machine.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Mips32/64 little endian target machine.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Definition: StringMap.h:220
Target - Wrapper for Target specific information.
TargetOptions Options
Definition: TargetMachine.h:97
MipsTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT, bool isLittle)
bool isMachineVerifierClean() const override
Returns true if the target is expected to pass all machine verifier checks.
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49