LLVM  9.0.0svn
PPCTargetMachine.h
Go to the documentation of this file.
1 //===-- PPCTargetMachine.h - Define TargetMachine for PowerPC ---*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the PowerPC specific subclass of TargetMachine.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
14 #define LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
15 
16 #include "PPCInstrInfo.h"
17 #include "PPCSubtarget.h"
18 #include "llvm/IR/DataLayout.h"
20 
21 namespace llvm {
22 
23 /// Common code between 32-bit and 64-bit PowerPC targets.
24 ///
25 class PPCTargetMachine final : public LLVMTargetMachine {
26 public:
28 private:
29  std::unique_ptr<TargetLoweringObjectFile> TLOF;
30  PPCABI TargetABI;
31 
32  mutable StringMap<std::unique_ptr<PPCSubtarget>> SubtargetMap;
33 
34 public:
35  PPCTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
36  StringRef FS, const TargetOptions &Options,
38  CodeGenOpt::Level OL, bool JIT);
39 
40  ~PPCTargetMachine() override;
41 
42  const PPCSubtarget *getSubtargetImpl(const Function &F) const override;
43  // DO NOT IMPLEMENT: There is no such thing as a valid default subtarget,
44  // subtargets are per-function entities based on the target-specific
45  // attributes of each function.
46  const PPCSubtarget *getSubtargetImpl() const = delete;
47 
48  // Pass Pipeline Configuration
50 
52 
54  return TLOF.get();
55  }
56  bool isELFv2ABI() const { return TargetABI == PPC_ABI_ELFv2; }
57  bool isPPC64() const {
58  const Triple &TT = getTargetTriple();
59  return (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le);
60  };
61 
62  bool isMachineVerifierClean() const override {
63  return false;
64  }
65 };
66 } // end namespace llvm
67 
68 #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:23
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:289
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:43
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:219
Target - Wrapper for Target specific information.
TargetOptions Options
Definition: TargetMachine.h:96
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48