WebAssemblyTargetMachine.h revision 327952
1285163Sdim// WebAssemblyTargetMachine.h - Define TargetMachine for WebAssembly -*- C++ -*-
2285163Sdim//
3285163Sdim//                     The LLVM Compiler Infrastructure
4285163Sdim//
5285163Sdim// This file is distributed under the University of Illinois Open Source
6285163Sdim// License. See LICENSE.TXT for details.
7285163Sdim//
8285163Sdim//===----------------------------------------------------------------------===//
9285163Sdim///
10285163Sdim/// \file
11285163Sdim/// \brief This file declares the WebAssembly-specific subclass of
12285163Sdim/// TargetMachine.
13285163Sdim///
14285163Sdim//===----------------------------------------------------------------------===//
15285163Sdim
16285163Sdim#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H
17285163Sdim#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H
18285163Sdim
19285163Sdim#include "WebAssemblySubtarget.h"
20285163Sdim#include "llvm/Target/TargetMachine.h"
21285163Sdim
22285163Sdimnamespace llvm {
23285163Sdim
24285163Sdimclass WebAssemblyTargetMachine final : public LLVMTargetMachine {
25285163Sdim  std::unique_ptr<TargetLoweringObjectFile> TLOF;
26285163Sdim  mutable StringMap<std::unique_ptr<WebAssemblySubtarget>> SubtargetMap;
27285163Sdim
28285163Sdimpublic:
29285163Sdim  WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
30285163Sdim                           StringRef FS, const TargetOptions &Options,
31327952Sdim                           Optional<Reloc::Model> RM,
32327952Sdim                           Optional<CodeModel::Model> CM, CodeGenOpt::Level OL,
33327952Sdim                           bool JIT);
34285163Sdim
35285163Sdim  ~WebAssemblyTargetMachine() override;
36285163Sdim  const WebAssemblySubtarget *
37285163Sdim  getSubtargetImpl(const Function &F) const override;
38285163Sdim
39285163Sdim  // Pass Pipeline Configuration
40285163Sdim  TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
41285163Sdim
42285163Sdim  TargetLoweringObjectFile *getObjFileLowering() const override {
43285163Sdim    return TLOF.get();
44285163Sdim  }
45285163Sdim
46327952Sdim  TargetTransformInfo getTargetTransformInfo(const Function &F) override;
47309124Sdim
48309124Sdim  bool usesPhysRegsForPEI() const override { return false; }
49285163Sdim};
50285163Sdim
51285163Sdim} // end namespace llvm
52285163Sdim
53285163Sdim#endif
54