blob: f1415ee59cc4c0b1dc30fa9344fad42bfb713082 [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//===-- WebAssemblySubtarget.cpp - WebAssembly Subtarget Information ------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
11/// \brief This file implements the WebAssembly-specific subclass of
12/// TargetSubtarget.
13///
14//===----------------------------------------------------------------------===//
15
16#include "WebAssemblyInstrInfo.h"
17#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
18#include "WebAssemblySubtarget.h"
19#include "llvm/Support/TargetRegistry.h"
20using namespace llvm;
21
22#define DEBUG_TYPE "subtarget"
23
24#define GET_SUBTARGETINFO_CTOR
25#define GET_SUBTARGETINFO_TARGET_DESC
26#include "WebAssemblyGenSubtargetInfo.inc"
27
28WebAssemblySubtarget &
29WebAssemblySubtarget::initializeSubtargetDependencies(StringRef FS) {
30 // Determine default and user-specified characteristics
31
32 if (CPUString.empty())
33 CPUString = "generic";
34
35 ParseSubtargetFeatures(CPUString, FS);
36 return *this;
37}
38
39WebAssemblySubtarget::WebAssemblySubtarget(const Triple &TT,
40 const std::string &CPU,
41 const std::string &FS,
42 const TargetMachine &TM)
43 : WebAssemblyGenSubtargetInfo(TT, CPU, FS), HasSIMD(true), CPUString(CPU),
44 TargetTriple(TT), FrameLowering(),
45 InstrInfo(initializeSubtargetDependencies(FS)),
46 TSInfo(TM.getDataLayout()), TLInfo(TM, *this) {}
47
48bool WebAssemblySubtarget::enableMachineScheduler() const { return true; }