Path: blob/main/contrib/llvm-project/llvm/lib/Target/Lanai/LanaiSubtarget.cpp
35271 views
//===- LanaiSubtarget.cpp - Lanai Subtarget Information -----------*- C++ -*-=//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file implements the Lanai specific subclass of TargetSubtarget.9//10//===----------------------------------------------------------------------===//1112#include "LanaiSubtarget.h"1314#include "Lanai.h"1516#define DEBUG_TYPE "lanai-subtarget"1718#define GET_SUBTARGETINFO_TARGET_DESC19#define GET_SUBTARGETINFO_CTOR20#include "LanaiGenSubtargetInfo.inc"2122using namespace llvm;2324void LanaiSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {25std::string CPUName = std::string(CPU);26if (CPUName.empty())27CPUName = "generic";2829ParseSubtargetFeatures(CPUName, /*TuneCPU*/ CPUName, FS);30}3132LanaiSubtarget &LanaiSubtarget::initializeSubtargetDependencies(StringRef CPU,33StringRef FS) {34initSubtargetFeatures(CPU, FS);35return *this;36}3738LanaiSubtarget::LanaiSubtarget(const Triple &TargetTriple, StringRef Cpu,39StringRef FeatureString, const TargetMachine &TM,40const TargetOptions & /*Options*/,41CodeModel::Model /*CodeModel*/,42CodeGenOptLevel /*OptLevel*/)43: LanaiGenSubtargetInfo(TargetTriple, Cpu, /*TuneCPU*/ Cpu, FeatureString),44FrameLowering(initializeSubtargetDependencies(Cpu, FeatureString)),45TLInfo(TM, *this) {}464748