LLVM  10.0.0svn
WebAssemblyTargetMachine.h
Go to the documentation of this file.
1 // WebAssemblyTargetMachine.h - Define TargetMachine for WebAssembly -*- 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 /// \file
10 /// This file declares the WebAssembly-specific subclass of
11 /// TargetMachine.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H
16 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H
17 
18 #include "WebAssemblySubtarget.h"
20 
21 namespace llvm {
22 
24  std::unique_ptr<TargetLoweringObjectFile> TLOF;
26 
27 public:
28  WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
29  StringRef FS, const TargetOptions &Options,
32  bool JIT);
33 
34  ~WebAssemblyTargetMachine() override;
35 
36  const WebAssemblySubtarget *getSubtargetImpl(std::string CPU,
37  std::string FS) const;
38  const WebAssemblySubtarget *
39  getSubtargetImpl(const Function &F) const override;
40 
41  // Pass Pipeline Configuration
43 
45  return TLOF.get();
46  }
47 
49 
50  bool usesPhysRegsForPEI() const override { return false; }
51 
54  convertFuncInfoToYAML(const MachineFunction &MF) const override;
58  SMRange &SourceRange) const override;
59 };
60 
61 } // end namespace llvm
62 
63 #endif
Represents a range in source code.
Definition: SMLoc.h:48
This class represents lattice values for constants.
Definition: AllocatorList.h:23
yaml::MachineFunctionInfo * createDefaultFuncInfoYAML() const override
Allocate and return a default initialized instance of the YAML representation for the MachineFunction...
F(f)
Target-Independent Code Generator Pass Configuration Options.
bool parseMachineFunctionInfo(const yaml::MachineFunctionInfo &, PerFunctionMIParsingState &PFS, SMDiagnostic &Error, SMRange &SourceRange) const override
Parse out the target&#39;s MachineFunctionInfo from the YAML reprsentation.
bool usesPhysRegsForPEI() const override
True if the target uses physical regs at Prolog/Epilog insertion time.
TargetLoweringObjectFile * getObjFileLowering() const 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:43
This file declares the WebAssembly-specific subclass of TargetSubtarget.
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 ...
yaml::MachineFunctionInfo * convertFuncInfoToYAML(const MachineFunction &MF) const override
Allocate and initialize an instance of the YAML representation of the MachineFunctionInfo.
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
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.
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
const WebAssemblySubtarget * getSubtargetImpl(std::string CPU, std::string FS) const
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
TargetOptions Options
WebAssemblyTargetMachine(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)
Create an WebAssembly architecture model.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
Definition: SourceMgr.h:261