Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 1 | //===-- AVRSubtarget.cpp - AVR Subtarget Information ----------------------===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file implements the AVR specific subclass of TargetSubtargetInfo. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #include "AVRSubtarget.h" |
| 14 | |
Zachary Turner | 264b5d9 | 2017-06-07 03:48:56 +0000 | [diff] [blame] | 15 | #include "llvm/BinaryFormat/ELF.h" |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 16 | #include "llvm/Support/TargetRegistry.h" |
| 17 | |
| 18 | #include "AVR.h" |
| 19 | #include "AVRTargetMachine.h" |
| 20 | #include "MCTargetDesc/AVRMCTargetDesc.h" |
| 21 | |
| 22 | #define DEBUG_TYPE "avr-subtarget" |
| 23 | |
| 24 | #define GET_SUBTARGETINFO_TARGET_DESC |
| 25 | #define GET_SUBTARGETINFO_CTOR |
| 26 | #include "AVRGenSubtargetInfo.inc" |
| 27 | |
| 28 | namespace llvm { |
| 29 | |
| 30 | AVRSubtarget::AVRSubtarget(const Triple &TT, const std::string &CPU, |
Dylan McKay | 7203e00 | 2019-01-18 06:10:41 +0000 | [diff] [blame] | 31 | const std::string &FS, const AVRTargetMachine &TM) |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 32 | : AVRGenSubtargetInfo(TT, CPU, FS), InstrInfo(), FrameLowering(), |
Dylan McKay | 7203e00 | 2019-01-18 06:10:41 +0000 | [diff] [blame] | 33 | TLInfo(TM, initializeSubtargetDependencies(CPU, FS, TM)), TSInfo(), |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 34 | |
| 35 | // Subtarget features |
| 36 | m_hasSRAM(false), m_hasJMPCALL(false), m_hasIJMPCALL(false), |
| 37 | m_hasEIJMPCALL(false), m_hasADDSUBIW(false), m_hasSmallStack(false), |
| 38 | m_hasMOVW(false), m_hasLPM(false), m_hasLPMX(false), m_hasELPM(false), |
| 39 | m_hasELPMX(false), m_hasSPM(false), m_hasSPMX(false), m_hasDES(false), |
| 40 | m_supportsRMW(false), m_supportsMultiplication(false), m_hasBREAK(false), |
| 41 | m_hasTinyEncoding(false), ELFArch(false), m_FeatureSetDummy(false) { |
| 42 | // Parse features string. |
| 43 | ParseSubtargetFeatures(CPU, FS); |
| 44 | } |
| 45 | |
Dylan McKay | 7203e00 | 2019-01-18 06:10:41 +0000 | [diff] [blame] | 46 | AVRSubtarget & |
| 47 | AVRSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS, |
| 48 | const TargetMachine &TM) { |
| 49 | // Parse features string. |
| 50 | ParseSubtargetFeatures(CPU, FS); |
| 51 | return *this; |
| 52 | } |
| 53 | |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 54 | } // end of namespace llvm |