109467b48Spatrick //===-- AVRSubtarget.cpp - AVR Subtarget Information ----------------------===//
209467b48Spatrick //
309467b48Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
409467b48Spatrick // See https://llvm.org/LICENSE.txt for license information.
509467b48Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
609467b48Spatrick //
709467b48Spatrick //===----------------------------------------------------------------------===//
809467b48Spatrick //
909467b48Spatrick // This file implements the AVR specific subclass of TargetSubtargetInfo.
1009467b48Spatrick //
1109467b48Spatrick //===----------------------------------------------------------------------===//
1209467b48Spatrick
1309467b48Spatrick #include "AVRSubtarget.h"
1409467b48Spatrick
1509467b48Spatrick #include "llvm/BinaryFormat/ELF.h"
16*d415bd75Srobert #include "llvm/MC/TargetRegistry.h"
1709467b48Spatrick
1809467b48Spatrick #include "AVR.h"
1909467b48Spatrick #include "AVRTargetMachine.h"
2009467b48Spatrick #include "MCTargetDesc/AVRMCTargetDesc.h"
2109467b48Spatrick
2209467b48Spatrick #define DEBUG_TYPE "avr-subtarget"
2309467b48Spatrick
2409467b48Spatrick #define GET_SUBTARGETINFO_TARGET_DESC
2509467b48Spatrick #define GET_SUBTARGETINFO_CTOR
2609467b48Spatrick #include "AVRGenSubtargetInfo.inc"
2709467b48Spatrick
2809467b48Spatrick namespace llvm {
2909467b48Spatrick
AVRSubtarget(const Triple & TT,const std::string & CPU,const std::string & FS,const AVRTargetMachine & TM)3009467b48Spatrick AVRSubtarget::AVRSubtarget(const Triple &TT, const std::string &CPU,
3109467b48Spatrick const std::string &FS, const AVRTargetMachine &TM)
32*d415bd75Srobert : AVRGenSubtargetInfo(TT, CPU, /*TuneCPU*/ CPU, FS),
33*d415bd75Srobert TLInfo(TM, initializeSubtargetDependencies(CPU, FS, TM)) {
3409467b48Spatrick // Parse features string.
3573471bf0Spatrick ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS);
3609467b48Spatrick }
3709467b48Spatrick
3809467b48Spatrick AVRSubtarget &
initializeSubtargetDependencies(StringRef CPU,StringRef FS,const TargetMachine & TM)3909467b48Spatrick AVRSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS,
4009467b48Spatrick const TargetMachine &TM) {
4109467b48Spatrick // Parse features string.
4273471bf0Spatrick ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS);
4309467b48Spatrick return *this;
4409467b48Spatrick }
4509467b48Spatrick
4609467b48Spatrick } // end of namespace llvm
47