LLVM  14.0.0git
BPFTargetMachine.h
Go to the documentation of this file.
1 //===-- BPFTargetMachine.h - Define TargetMachine for BPF --- 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 BPF specific subclass of TargetMachine.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_BPF_BPFTARGETMACHINE_H
14 #define LLVM_LIB_TARGET_BPF_BPFTARGETMACHINE_H
15 
16 #include "BPFSubtarget.h"
18 
19 namespace llvm {
21  std::unique_ptr<TargetLoweringObjectFile> TLOF;
22  BPFSubtarget Subtarget;
23 
24 public:
25  BPFTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
28  CodeGenOpt::Level OL, bool JIT);
29 
30  const BPFSubtarget *getSubtargetImpl() const { return &Subtarget; }
31  const BPFSubtarget *getSubtargetImpl(const Function &) const override {
32  return &Subtarget;
33  }
34 
36 
38 
40  return TLOF.get();
41  }
42 
43  void adjustPassManager(PassManagerBuilder &) override;
45 };
46 }
47 
48 #endif
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
BPFSubtarget.h
llvm::TargetOptions
Definition: TargetOptions.h:113
llvm::Function
Definition: Function.h:61
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
llvm::TargetTransformInfo
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Definition: TargetTransformInfo.h:167
llvm::BPFTargetMachine::createPassConfig
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
Definition: BPFTargetMachine.cpp:100
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::BPFTargetMachine::getSubtargetImpl
const BPFSubtarget * getSubtargetImpl(const Function &) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
Definition: BPFTargetMachine.h:31
llvm::TargetMachine::RM
Reloc::Model RM
Definition: TargetMachine.h:100
llvm::Optional< Reloc::Model >
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::BPFTargetMachine::getTargetTransformInfo
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
Definition: BPFTargetMachine.cpp:149
llvm::BPFTargetMachine::registerPassBuilderCallbacks
void registerPassBuilderCallbacks(PassBuilder &PB) override
Allow the target to modify the pass pipeline with New Pass Manager (similar to adjustPassManager for ...
Definition: BPFTargetMachine.cpp:125
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::TargetLoweringObjectFile
Definition: TargetLoweringObjectFile.h:43
llvm::BPFTargetMachine::getSubtargetImpl
const BPFSubtarget * getSubtargetImpl() const
Definition: BPFTargetMachine.h:30
TargetMachine.h
llvm::PassBuilder
This class provides access to building LLVM's passes.
Definition: PassBuilder.h:134
llvm::PassManagerBuilder
PassManagerBuilder - This class is used to set up a standard optimization sequence for languages like...
Definition: PassManagerBuilder.h:59
PB
PassBuilder PB(Machine, PassOpts->PTO, None, &PIC)
llvm::TargetPassConfig
Target-Independent Code Generator Pass Configuration Options.
Definition: TargetPassConfig.h:84
llvm::EngineKind::JIT
@ JIT
Definition: ExecutionEngine.h:525
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::TargetMachine::Options
TargetOptions Options
Definition: TargetMachine.h:115
llvm::BPFTargetMachine::getObjFileLowering
TargetLoweringObjectFile * getObjFileLowering() const override
Definition: BPFTargetMachine.h:39
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::BPFTargetMachine::adjustPassManager
void adjustPassManager(PassManagerBuilder &) override
Allow the target to modify the pass manager, e.g.
Definition: BPFTargetMachine.cpp:104
llvm::BPFTargetMachine
Definition: BPFTargetMachine.h:20
llvm::LLVMTargetMachine
This class describes a target machine that is implemented with the LLVM target-independent code gener...
Definition: TargetMachine.h:385
llvm::BPFTargetMachine::BPFTargetMachine
BPFTargetMachine(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)
Definition: BPFTargetMachine.cpp:64
llvm::legacy::PassManagerBase
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Definition: LegacyPassManager.h:39
llvm::BPFSubtarget
Definition: BPFSubtarget.h:31