1 //===- LanaiSubtarget.cpp - Lanai Subtarget Information -----------*- C++ -*-=//
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 // This file implements the Lanai specific subclass of TargetSubtarget.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "LanaiSubtarget.h"
15
16 #include "Lanai.h"
17
18 #define DEBUG_TYPE "lanai-subtarget"
19
20 #define GET_SUBTARGETINFO_TARGET_DESC
21 #define GET_SUBTARGETINFO_CTOR
22 #include "LanaiGenSubtargetInfo.inc"
23
24 using namespace llvm;
25
initSubtargetFeatures(StringRef CPU,StringRef FS)26 void LanaiSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
27 std::string CPUName = CPU;
28 if (CPUName.empty())
29 CPUName = "generic";
30
31 ParseSubtargetFeatures(CPUName, FS);
32 }
33
initializeSubtargetDependencies(StringRef CPU,StringRef FS)34 LanaiSubtarget &LanaiSubtarget::initializeSubtargetDependencies(StringRef CPU,
35 StringRef FS) {
36 initSubtargetFeatures(CPU, FS);
37 return *this;
38 }
39
LanaiSubtarget(const Triple & TargetTriple,StringRef Cpu,StringRef FeatureString,const TargetMachine & TM,const TargetOptions & Options,CodeModel::Model CodeModel,CodeGenOpt::Level OptLevel)40 LanaiSubtarget::LanaiSubtarget(const Triple &TargetTriple, StringRef Cpu,
41 StringRef FeatureString, const TargetMachine &TM,
42 const TargetOptions &Options,
43 CodeModel::Model CodeModel,
44 CodeGenOpt::Level OptLevel)
45 : LanaiGenSubtargetInfo(TargetTriple, Cpu, FeatureString),
46 FrameLowering(initializeSubtargetDependencies(Cpu, FeatureString)),
47 InstrInfo(), TLInfo(TM, *this), TSInfo() {}
48