LLVM  17.0.0git
AVRSubtarget.cpp
Go to the documentation of this file.
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"
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),
33  TLInfo(TM, initializeSubtargetDependencies(CPU, FS, TM)) {
34  // Parse features string.
35  ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS);
36 }
37 
40  const TargetMachine &TM) {
41  // Parse features string.
42  ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS);
43  return *this;
44 }
45 
46 } // end of namespace llvm
llvm::AVRSubtarget::initializeSubtargetDependencies
AVRSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS, const TargetMachine &TM)
Definition: AVRSubtarget.cpp:39
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::AVRTargetMachine
A generic AVR implementation.
Definition: AVRTargetMachine.h:30
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::X86AS::FS
@ FS
Definition: X86.h:201
AVRGenSubtargetInfo
ELF.h
llvm::AVRSubtarget
A specific AVR target MCU.
Definition: AVRSubtarget.h:32
llvm::AVRSubtarget::AVRSubtarget
AVRSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const AVRTargetMachine &TM)
Creates an AVR subtarget.
Definition: AVRSubtarget.cpp:30
AVRTargetMachine.h
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:78
AVRMCTargetDesc.h
AVRSubtarget.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::AVRSubtarget::ParseSubtargetFeatures
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
Parses a subtarget feature string, setting appropriate options.
AVR.h
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
TargetRegistry.h