xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AVR/AVRSubtarget.cpp (revision d56accc7c3dcc897489b6a07834763a03b9f3d68)
1 //===-- AVRSubtarget.cpp - AVR Subtarget Information ----------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the AVR specific subclass of TargetSubtargetInfo.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "AVRSubtarget.h"
14 
15 #include "llvm/BinaryFormat/ELF.h"
16 #include "llvm/MC/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,
31                            const std::string &FS, const AVRTargetMachine &TM)
32     : AVRGenSubtargetInfo(TT, CPU, /*TuneCPU*/ CPU, FS), ELFArch(0),
33 
34       // Subtarget features
35       m_hasSRAM(false), m_hasJMPCALL(false), m_hasIJMPCALL(false),
36       m_hasEIJMPCALL(false), m_hasADDSUBIW(false), m_hasSmallStack(false),
37       m_hasMOVW(false), m_hasLPM(false), m_hasLPMX(false), m_hasELPM(false),
38       m_hasELPMX(false), m_hasSPM(false), m_hasSPMX(false), m_hasDES(false),
39       m_supportsRMW(false), m_supportsMultiplication(false), m_hasBREAK(false),
40       m_hasTinyEncoding(false), m_hasMemMappedGPR(false),
41       m_FeatureSetDummy(false),
42 
43       TLInfo(TM, initializeSubtargetDependencies(CPU, FS, TM)) {
44   // Parse features string.
45   ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS);
46 }
47 
48 AVRSubtarget &
49 AVRSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS,
50                                               const TargetMachine &TM) {
51   // Parse features string.
52   ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS);
53   return *this;
54 }
55 
56 } // end of namespace llvm
57