WebAssemblyTargetMachine.h revision 285181
1132242Stjr// WebAssemblyTargetMachine.h - Define TargetMachine for WebAssembly -*- C++ -*-
2132242Stjr//
3132242Stjr//                     The LLVM Compiler Infrastructure
4132242Stjr//
5227753Stheraven// This file is distributed under the University of Illinois Open Source
6227753Stheraven// License. See LICENSE.TXT for details.
7227753Stheraven//
8227753Stheraven//===----------------------------------------------------------------------===//
9227753Stheraven///
10132242Stjr/// \file
11132242Stjr/// \brief This file declares the WebAssembly-specific subclass of
12132242Stjr/// TargetMachine.
13132242Stjr///
14132242Stjr//===----------------------------------------------------------------------===//
15132242Stjr
16132242Stjr#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H
17132242Stjr#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H
18132242Stjr
19132242Stjr#include "WebAssemblySubtarget.h"
20132242Stjr#include "llvm/Target/TargetMachine.h"
21132242Stjr
22132242Stjrnamespace llvm {
23132242Stjr
24132242Stjrclass WebAssemblyTargetMachine final : public LLVMTargetMachine {
25132242Stjr  std::unique_ptr<TargetLoweringObjectFile> TLOF;
26132242Stjr  mutable StringMap<std::unique_ptr<WebAssemblySubtarget>> SubtargetMap;
27132242Stjr
28132242Stjrpublic:
29132242Stjr  WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
30132242Stjr                           StringRef FS, const TargetOptions &Options,
31132242Stjr                           Reloc::Model RM, CodeModel::Model CM,
32132242Stjr                           CodeGenOpt::Level OL);
33132242Stjr
34132242Stjr  ~WebAssemblyTargetMachine() override;
35132242Stjr  const WebAssemblySubtarget *
36132242Stjr  getSubtargetImpl(const Function &F) const override;
37132242Stjr
38132242Stjr  // Pass Pipeline Configuration
39132242Stjr  TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
40132242Stjr
41227753Stheraven  TargetLoweringObjectFile *getObjFileLowering() const override {
42132242Stjr    return TLOF.get();
43132242Stjr  }
44227753Stheraven
45132242Stjr  /// \brief Get the TargetIRAnalysis for this target.
46132242Stjr  TargetIRAnalysis getTargetIRAnalysis() override;
47132242Stjr};
48227753Stheraven
49132242Stjr} // end namespace llvm
50132242Stjr
51132242Stjr#endif
52132242Stjr