LLVM 20.0.0git
AVRELFStreamer.cpp
Go to the documentation of this file.
1#include "AVRELFStreamer.h"
2#include "AVRMCTargetDesc.h"
7
8namespace llvm {
9
10static unsigned getEFlagsForFeatureSet(const FeatureBitset &Features) {
11 unsigned EFlags = 0;
12
13 // Set architecture
14 if (Features[AVR::ELFArchAVR1])
15 EFlags |= ELF::EF_AVR_ARCH_AVR1;
16 else if (Features[AVR::ELFArchAVR2])
17 EFlags |= ELF::EF_AVR_ARCH_AVR2;
18 else if (Features[AVR::ELFArchAVR25])
19 EFlags |= ELF::EF_AVR_ARCH_AVR25;
20 else if (Features[AVR::ELFArchAVR3])
21 EFlags |= ELF::EF_AVR_ARCH_AVR3;
22 else if (Features[AVR::ELFArchAVR31])
23 EFlags |= ELF::EF_AVR_ARCH_AVR31;
24 else if (Features[AVR::ELFArchAVR35])
25 EFlags |= ELF::EF_AVR_ARCH_AVR35;
26 else if (Features[AVR::ELFArchAVR4])
27 EFlags |= ELF::EF_AVR_ARCH_AVR4;
28 else if (Features[AVR::ELFArchAVR5])
29 EFlags |= ELF::EF_AVR_ARCH_AVR5;
30 else if (Features[AVR::ELFArchAVR51])
31 EFlags |= ELF::EF_AVR_ARCH_AVR51;
32 else if (Features[AVR::ELFArchAVR6])
33 EFlags |= ELF::EF_AVR_ARCH_AVR6;
34 else if (Features[AVR::ELFArchTiny])
36 else if (Features[AVR::ELFArchXMEGA1])
38 else if (Features[AVR::ELFArchXMEGA2])
40 else if (Features[AVR::ELFArchXMEGA3])
42 else if (Features[AVR::ELFArchXMEGA4])
44 else if (Features[AVR::ELFArchXMEGA5])
46 else if (Features[AVR::ELFArchXMEGA6])
48 else if (Features[AVR::ELFArchXMEGA7])
50
51 return EFlags;
52}
53
57 unsigned EFlags = W.getELFHeaderEFlags();
58
61
62 W.setELFHeaderEFlags(EFlags);
63}
64
65} // end namespace llvm
MCELFStreamer & getStreamer()
AVRELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
A generic AVR target output stream.
Container class for subtarget features.
ELFObjectWriter & getWriter()
Streaming machine code generation interface.
Definition: MCStreamer.h:213
Generic base class for all target subtargets.
const FeatureBitset & getFeatureBits() const
@ EF_AVR_ARCH_XMEGA1
Definition: ELF.h:491
@ EF_AVR_ARCH_AVR35
Definition: ELF.h:485
@ EF_AVR_ARCH_AVR51
Definition: ELF.h:488
@ EF_AVR_ARCH_AVR1
Definition: ELF.h:480
@ EF_AVR_ARCH_AVRTINY
Definition: ELF.h:490
@ EF_AVR_ARCH_XMEGA3
Definition: ELF.h:493
@ EF_AVR_ARCH_XMEGA5
Definition: ELF.h:495
@ EF_AVR_ARCH_AVR6
Definition: ELF.h:489
@ EF_AVR_ARCH_AVR2
Definition: ELF.h:481
@ EF_AVR_ARCH_XMEGA2
Definition: ELF.h:492
@ EF_AVR_LINKRELAX_PREPARED
Definition: ELF.h:501
@ EF_AVR_ARCH_XMEGA7
Definition: ELF.h:497
@ EF_AVR_ARCH_XMEGA6
Definition: ELF.h:496
@ EF_AVR_ARCH_AVR5
Definition: ELF.h:487
@ EF_AVR_ARCH_AVR25
Definition: ELF.h:482
@ EF_AVR_ARCH_AVR3
Definition: ELF.h:483
@ EF_AVR_ARCH_XMEGA4
Definition: ELF.h:494
@ EF_AVR_ARCH_AVR31
Definition: ELF.h:484
@ EF_AVR_ARCH_AVR4
Definition: ELF.h:486
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
static unsigned getEFlagsForFeatureSet(const FeatureBitset &Features)