LLVM 19.0.0git
AVRELFStreamer.cpp
Go to the documentation of this file.
1#include "AVRELFStreamer.h"
2
8
9#include "AVRMCTargetDesc.h"
10
11namespace llvm {
12
13static unsigned getEFlagsForFeatureSet(const FeatureBitset &Features) {
14 unsigned EFlags = 0;
15
16 // Set architecture
17 if (Features[AVR::ELFArchAVR1])
18 EFlags |= ELF::EF_AVR_ARCH_AVR1;
19 else if (Features[AVR::ELFArchAVR2])
20 EFlags |= ELF::EF_AVR_ARCH_AVR2;
21 else if (Features[AVR::ELFArchAVR25])
22 EFlags |= ELF::EF_AVR_ARCH_AVR25;
23 else if (Features[AVR::ELFArchAVR3])
24 EFlags |= ELF::EF_AVR_ARCH_AVR3;
25 else if (Features[AVR::ELFArchAVR31])
26 EFlags |= ELF::EF_AVR_ARCH_AVR31;
27 else if (Features[AVR::ELFArchAVR35])
28 EFlags |= ELF::EF_AVR_ARCH_AVR35;
29 else if (Features[AVR::ELFArchAVR4])
30 EFlags |= ELF::EF_AVR_ARCH_AVR4;
31 else if (Features[AVR::ELFArchAVR5])
32 EFlags |= ELF::EF_AVR_ARCH_AVR5;
33 else if (Features[AVR::ELFArchAVR51])
34 EFlags |= ELF::EF_AVR_ARCH_AVR51;
35 else if (Features[AVR::ELFArchAVR6])
36 EFlags |= ELF::EF_AVR_ARCH_AVR6;
37 else if (Features[AVR::ELFArchTiny])
39 else if (Features[AVR::ELFArchXMEGA1])
41 else if (Features[AVR::ELFArchXMEGA2])
43 else if (Features[AVR::ELFArchXMEGA3])
45 else if (Features[AVR::ELFArchXMEGA4])
47 else if (Features[AVR::ELFArchXMEGA5])
49 else if (Features[AVR::ELFArchXMEGA6])
51 else if (Features[AVR::ELFArchXMEGA7])
53
54 return EFlags;
55}
56
59
61 unsigned EFlags = MCA.getELFHeaderEFlags();
62
65
66 MCA.setELFHeaderEFlags(EFlags);
67}
68
69} // end namespace llvm
MCELFStreamer & getStreamer()
AVRELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
A generic AVR target output stream.
Container class for subtarget features.
unsigned getELFHeaderEFlags() const
ELF e_header flags.
Definition: MCAssembler.h:281
void setELFHeaderEFlags(unsigned Flags)
Definition: MCAssembler.h:282
MCAssembler & getAssembler()
Streaming machine code generation interface.
Definition: MCStreamer.h:212
Generic base class for all target subtargets.
const FeatureBitset & getFeatureBits() const
@ EF_AVR_ARCH_XMEGA1
Definition: ELF.h:490
@ EF_AVR_ARCH_AVR35
Definition: ELF.h:484
@ EF_AVR_ARCH_AVR51
Definition: ELF.h:487
@ EF_AVR_ARCH_AVR1
Definition: ELF.h:479
@ EF_AVR_ARCH_AVRTINY
Definition: ELF.h:489
@ EF_AVR_ARCH_XMEGA3
Definition: ELF.h:492
@ EF_AVR_ARCH_XMEGA5
Definition: ELF.h:494
@ EF_AVR_ARCH_AVR6
Definition: ELF.h:488
@ EF_AVR_ARCH_AVR2
Definition: ELF.h:480
@ EF_AVR_ARCH_XMEGA2
Definition: ELF.h:491
@ EF_AVR_LINKRELAX_PREPARED
Definition: ELF.h:500
@ EF_AVR_ARCH_XMEGA7
Definition: ELF.h:496
@ EF_AVR_ARCH_XMEGA6
Definition: ELF.h:495
@ EF_AVR_ARCH_AVR5
Definition: ELF.h:486
@ EF_AVR_ARCH_AVR25
Definition: ELF.h:481
@ EF_AVR_ARCH_AVR3
Definition: ELF.h:482
@ EF_AVR_ARCH_XMEGA4
Definition: ELF.h:493
@ EF_AVR_ARCH_AVR31
Definition: ELF.h:483
@ EF_AVR_ARCH_AVR4
Definition: ELF.h:485
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
static unsigned getEFlagsForFeatureSet(const FeatureBitset &Features)