Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / lib / Target / WebAssembly / WebAssemblyTargetMachine.h
blobe13ad7d4eacbfec89d01062eacb497877c102d74
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 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H
16 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETMACHINE_H
18 #include "WebAssemblySubtarget.h"
19 #include "llvm/Target/TargetMachine.h"
21 namespace llvm {
23 class WebAssemblyTargetMachine final : public LLVMTargetMachine {
24 std::unique_ptr<TargetLoweringObjectFile> TLOF;
25 mutable StringMap<std::unique_ptr<WebAssemblySubtarget>> SubtargetMap;
27 public:
28 WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
29 StringRef FS, const TargetOptions &Options,
30 Optional<Reloc::Model> RM,
31 Optional<CodeModel::Model> CM, CodeGenOpt::Level OL,
32 bool JIT);
34 ~WebAssemblyTargetMachine() override;
35 const WebAssemblySubtarget *
36 getSubtargetImpl(const Function &F) const override;
38 // Pass Pipeline Configuration
39 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
41 TargetLoweringObjectFile *getObjFileLowering() const override {
42 return TLOF.get();
45 TargetTransformInfo getTargetTransformInfo(const Function &F) override;
47 bool usesPhysRegsForPEI() const override { return false; }
50 } // end namespace llvm
52 #endif