10b57cec5SDimitry Andric //===-- AVRSubtarget.cpp - AVR Subtarget Information ----------------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric // This file implements the AVR specific subclass of TargetSubtargetInfo.
100b57cec5SDimitry Andric //
110b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric
130b57cec5SDimitry Andric #include "AVRSubtarget.h"
140b57cec5SDimitry Andric
150b57cec5SDimitry Andric #include "llvm/BinaryFormat/ELF.h"
16349cc55cSDimitry Andric #include "llvm/MC/TargetRegistry.h"
170b57cec5SDimitry Andric
180b57cec5SDimitry Andric #include "AVR.h"
190b57cec5SDimitry Andric #include "AVRTargetMachine.h"
200b57cec5SDimitry Andric #include "MCTargetDesc/AVRMCTargetDesc.h"
210b57cec5SDimitry Andric
220b57cec5SDimitry Andric #define DEBUG_TYPE "avr-subtarget"
230b57cec5SDimitry Andric
240b57cec5SDimitry Andric #define GET_SUBTARGETINFO_TARGET_DESC
250b57cec5SDimitry Andric #define GET_SUBTARGETINFO_CTOR
260b57cec5SDimitry Andric #include "AVRGenSubtargetInfo.inc"
270b57cec5SDimitry Andric
280b57cec5SDimitry Andric namespace llvm {
290b57cec5SDimitry Andric
AVRSubtarget(const Triple & TT,const std::string & CPU,const std::string & FS,const AVRTargetMachine & TM)300b57cec5SDimitry Andric AVRSubtarget::AVRSubtarget(const Triple &TT, const std::string &CPU,
310b57cec5SDimitry Andric const std::string &FS, const AVRTargetMachine &TM)
32*06c3fb27SDimitry Andric : AVRGenSubtargetInfo(TT, CPU, /*TuneCPU*/ CPU, FS), InstrInfo(*this),
3304eeddc0SDimitry Andric TLInfo(TM, initializeSubtargetDependencies(CPU, FS, TM)) {
340b57cec5SDimitry Andric // Parse features string.
35e8d8bef9SDimitry Andric ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS);
360b57cec5SDimitry Andric }
370b57cec5SDimitry Andric
380b57cec5SDimitry Andric AVRSubtarget &
initializeSubtargetDependencies(StringRef CPU,StringRef FS,const TargetMachine & TM)390b57cec5SDimitry Andric AVRSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS,
400b57cec5SDimitry Andric const TargetMachine &TM) {
410b57cec5SDimitry Andric // Parse features string.
42e8d8bef9SDimitry Andric ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS);
430b57cec5SDimitry Andric return *this;
440b57cec5SDimitry Andric }
450b57cec5SDimitry Andric
460b57cec5SDimitry Andric } // end of namespace llvm
47