1 //===- LanaiSubtarget.cpp - Lanai Subtarget Information -----------*- C++ -*-=//
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
7 //===----------------------------------------------------------------------===//
9 // This file implements the Lanai specific subclass of TargetSubtarget.
11 //===----------------------------------------------------------------------===//
13 #include "LanaiSubtarget.h"
15 #define DEBUG_TYPE "lanai-subtarget"
17 #define GET_SUBTARGETINFO_TARGET_DESC
18 #define GET_SUBTARGETINFO_CTOR
19 #include "LanaiGenSubtargetInfo.inc"
23 void LanaiSubtarget::initSubtargetFeatures(StringRef CPU
, StringRef FS
) {
24 std::string CPUName
= std::string(CPU
);
28 ParseSubtargetFeatures(CPUName
, /*TuneCPU*/ CPUName
, FS
);
31 LanaiSubtarget
&LanaiSubtarget::initializeSubtargetDependencies(StringRef CPU
,
33 initSubtargetFeatures(CPU
, FS
);
37 LanaiSubtarget::LanaiSubtarget(const Triple
&TargetTriple
, StringRef Cpu
,
38 StringRef FeatureString
, const TargetMachine
&TM
,
39 const TargetOptions
& /*Options*/,
40 CodeModel::Model
/*CodeModel*/,
41 CodeGenOptLevel
/*OptLevel*/)
42 : LanaiGenSubtargetInfo(TargetTriple
, Cpu
, /*TuneCPU*/ Cpu
, FeatureString
),
43 FrameLowering(initializeSubtargetDependencies(Cpu
, FeatureString
)),