Path: blob/main/contrib/llvm-project/llvm/lib/Target/Xtensa/XtensaSubtarget.cpp
35271 views
//===- XtensaSubtarget.cpp - Xtensa Subtarget Information -----------------===//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 Xtensa specific subclass of TargetSubtargetInfo.9//10//===----------------------------------------------------------------------===//1112#include "XtensaSubtarget.h"13#include "llvm/IR/GlobalValue.h"14#include "llvm/Support/Debug.h"1516#define DEBUG_TYPE "xtensa-subtarget"1718#define GET_SUBTARGETINFO_TARGET_DESC19#define GET_SUBTARGETINFO_CTOR20#include "XtensaGenSubtargetInfo.inc"2122using namespace llvm;2324XtensaSubtarget &25XtensaSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) {26StringRef CPUName = CPU;27if (CPUName.empty()) {28// set default cpu name29CPUName = "generic";30}3132HasDensity = false;3334// Parse features string.35ParseSubtargetFeatures(CPUName, CPUName, FS);36return *this;37}3839XtensaSubtarget::XtensaSubtarget(const Triple &TT, StringRef CPU, StringRef FS,40const TargetMachine &TM)41: XtensaGenSubtargetInfo(TT, CPU, /*TuneCPU=*/CPU, FS), TargetTriple(TT),42InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),43TSInfo(), FrameLowering(*this) {}444546