1
- // ===-- XtensaMCAsmBackend.cpp - Xtensa assembler backend -----------------===//
2
- //
3
- // The LLVM Compiler Infrastructure
1
+ // ===----------------------------------------------------------------------===//
4
2
//
5
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6
4
// See https://llvm.org/LICENSE.txt for license information.
@@ -24,12 +22,14 @@ using namespace llvm;
24
22
25
23
namespace llvm {
26
24
class MCObjectTargetWriter ;
27
- class XtensaMCAsmBackend : public MCAsmBackend {
25
+ }
26
+ namespace {
27
+ class XtensaAsmBackend : public MCAsmBackend {
28
28
uint8_t OSABI;
29
29
bool IsLittleEndian;
30
30
31
31
public:
32
- XtensaMCAsmBackend (uint8_t osABI, bool isLE)
32
+ XtensaAsmBackend (uint8_t osABI, bool isLE)
33
33
: MCAsmBackend(llvm::endianness::little), OSABI(osABI),
34
34
IsLittleEndian (isLE) {}
35
35
@@ -49,9 +49,9 @@ class XtensaMCAsmBackend : public MCAsmBackend {
49
49
return createXtensaObjectWriter (OSABI, IsLittleEndian);
50
50
}
51
51
};
52
- } // namespace llvm
52
+ } // namespace
53
53
54
- MCFixupKindInfo XtensaMCAsmBackend ::getFixupKindInfo (MCFixupKind Kind) const {
54
+ MCFixupKindInfo XtensaAsmBackend ::getFixupKindInfo (MCFixupKind Kind) const {
55
55
const static MCFixupKindInfo Infos[Xtensa::NumTargetFixupKinds] = {
56
56
// name offset bits flags
57
57
{" fixup_xtensa_branch_6" , 0 , 16 , MCFixupKindInfo::FKF_IsPCRel},
@@ -144,11 +144,11 @@ static unsigned getSize(unsigned Kind) {
144
144
}
145
145
}
146
146
147
- void XtensaMCAsmBackend ::applyFixup (const MCAssembler &Asm,
148
- const MCFixup &Fixup, const MCValue &Target,
149
- MutableArrayRef<char > Data, uint64_t Value,
150
- bool IsResolved,
151
- const MCSubtargetInfo *STI) const {
147
+ void XtensaAsmBackend ::applyFixup (const MCAssembler &Asm, const MCFixup &Fixup ,
148
+ const MCValue &Target,
149
+ MutableArrayRef<char > Data, uint64_t Value,
150
+ bool IsResolved,
151
+ const MCSubtargetInfo *STI) const {
152
152
MCContext &Ctx = Asm.getContext ();
153
153
MCFixupKindInfo Info = getFixupKindInfo (Fixup.getKind ());
154
154
@@ -168,16 +168,16 @@ void XtensaMCAsmBackend::applyFixup(const MCAssembler &Asm,
168
168
}
169
169
}
170
170
171
- bool XtensaMCAsmBackend ::mayNeedRelaxation (const MCInst &Inst,
172
- const MCSubtargetInfo &STI) const {
171
+ bool XtensaAsmBackend ::mayNeedRelaxation (const MCInst &Inst,
172
+ const MCSubtargetInfo &STI) const {
173
173
return false ;
174
174
}
175
175
176
- void XtensaMCAsmBackend ::relaxInstruction (MCInst &Inst,
177
- const MCSubtargetInfo &STI) const {}
176
+ void XtensaAsmBackend ::relaxInstruction (MCInst &Inst,
177
+ const MCSubtargetInfo &STI) const {}
178
178
179
- bool XtensaMCAsmBackend ::writeNopData (raw_ostream &OS, uint64_t Count,
180
- const MCSubtargetInfo *STI) const {
179
+ bool XtensaAsmBackend ::writeNopData (raw_ostream &OS, uint64_t Count,
180
+ const MCSubtargetInfo *STI) const {
181
181
uint64_t NumNops24b = Count / 3 ;
182
182
183
183
for (uint64_t i = 0 ; i != NumNops24b; ++i) {
@@ -210,11 +210,11 @@ bool XtensaMCAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
210
210
return true ;
211
211
}
212
212
213
- MCAsmBackend *llvm::createXtensaMCAsmBackend (const Target &T,
214
- const MCSubtargetInfo &STI,
215
- const MCRegisterInfo &MRI,
216
- const MCTargetOptions &Options) {
213
+ MCAsmBackend *llvm::createXtensaAsmBackend (const Target &T,
214
+ const MCSubtargetInfo &STI,
215
+ const MCRegisterInfo &MRI,
216
+ const MCTargetOptions &Options) {
217
217
uint8_t OSABI =
218
218
MCELFObjectTargetWriter::getOSABI (STI.getTargetTriple ().getOS ());
219
- return new llvm::XtensaMCAsmBackend (OSABI, true );
219
+ return new XtensaAsmBackend (OSABI, true );
220
220
}
0 commit comments