LLVM  8.0.1
PPCTargetMachine.h
Go to the documentation of this file.
1 //===-- PPCTargetMachine.h - Define TargetMachine for PowerPC ---*- 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 PowerPC specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
16 
17 #include "PPCInstrInfo.h"
18 #include "PPCSubtarget.h"
19 #include "llvm/IR/DataLayout.h"
21 
22 namespace llvm {
23 
24 /// Common code between 32-bit and 64-bit PowerPC targets.
25 ///
26 class PPCTargetMachine final : public LLVMTargetMachine {
27 public:
29 private:
30  std::unique_ptr<TargetLoweringObjectFile> TLOF;
31  PPCABI TargetABI;
32 
33  mutable StringMap<std::unique_ptr<PPCSubtarget>> SubtargetMap;
34 
35 public:
36  PPCTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
37  StringRef FS, const TargetOptions &Options,
39  CodeGenOpt::Level OL, bool JIT);
40 
41  ~PPCTargetMachine() override;
42 
43  const PPCSubtarget *getSubtargetImpl(const Function &F) const override;
44  // DO NOT IMPLEMENT: There is no such thing as a valid default subtarget,
45  // subtargets are per-function entities based on the target-specific
46  // attributes of each function.
47  const PPCSubtarget *getSubtargetImpl() const = delete;
48 
49  // Pass Pipeline Configuration
51 
53 
55  return TLOF.get();
56  }
57  bool isELFv2ABI() const { return TargetABI == PPC_ABI_ELFv2; }
58  bool isPPC64() const {
59  const Triple &TT = getTargetTriple();
60  return (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le);
61  };
62 
63  bool isMachineVerifierClean() const override {
64  return false;
65  }
66 };
67 } // end namespace llvm
68 
69 #endif
bool isMachineVerifierClean() const override
Returns true if the target is expected to pass all machine verifier checks.
This class represents lattice values for constants.
Definition: AllocatorList.h:24
PPCTargetMachine(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)
F(f)
Target-Independent Code Generator Pass Configuration Options.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:290
const PPCSubtarget * getSubtargetImpl() const =delete
~PPCTargetMachine() override
TargetLoweringObjectFile * getObjFileLowering() const override
This class describes a target machine that is implemented with the LLVM target-independent code gener...
const Triple & getTargetTriple() const
Common code between 32-bit and 64-bit PowerPC targets.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
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
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49