LLVM  8.0.1
AVRSubtarget.cpp
Go to the documentation of this file.
1 //===-- AVRSubtarget.cpp - AVR Subtarget Information ----------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the AVR specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "AVRSubtarget.h"
15 
16 #include "llvm/BinaryFormat/ELF.h"
18 
19 #include "AVR.h"
20 #include "AVRTargetMachine.h"
22 
23 #define DEBUG_TYPE "avr-subtarget"
24 
25 #define GET_SUBTARGETINFO_TARGET_DESC
26 #define GET_SUBTARGETINFO_CTOR
27 #include "AVRGenSubtargetInfo.inc"
28 
29 namespace llvm {
30 
31 AVRSubtarget::AVRSubtarget(const Triple &TT, const std::string &CPU,
32  const std::string &FS, const AVRTargetMachine &TM)
33  : AVRGenSubtargetInfo(TT, CPU, FS), InstrInfo(), FrameLowering(),
34  TLInfo(TM, initializeSubtargetDependencies(CPU, FS, TM)), TSInfo(),
35 
36  // Subtarget features
37  m_hasSRAM(false), m_hasJMPCALL(false), m_hasIJMPCALL(false),
38  m_hasEIJMPCALL(false), m_hasADDSUBIW(false), m_hasSmallStack(false),
39  m_hasMOVW(false), m_hasLPM(false), m_hasLPMX(false), m_hasELPM(false),
40  m_hasELPMX(false), m_hasSPM(false), m_hasSPMX(false), m_hasDES(false),
41  m_supportsRMW(false), m_supportsMultiplication(false), m_hasBREAK(false),
42  m_hasTinyEncoding(false), ELFArch(false), m_FeatureSetDummy(false) {
43  // Parse features string.
44  ParseSubtargetFeatures(CPU, FS);
45 }
46 
49  const TargetMachine &TM) {
50  // Parse features string.
51  ParseSubtargetFeatures(CPU, FS);
52  return *this;
53 }
54 
55 } // end of namespace llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:24
A generic AVR implementation.
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
Parses a subtarget feature string, setting appropriate options.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
uint16_t ELFArch
Definition: ELFStub.h:26
A specific AVR target MCU.
Definition: AVRSubtarget.h:32
AVRSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS, const TargetMachine &TM)
AVRSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const AVRTargetMachine &TM)
Creates an AVR subtarget.
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:59
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49