1- // ===-- XtensaMCAsmBackend.cpp - Xtensa assembler backend -----------------===//
2- //
3- // The LLVM Compiler Infrastructure
1+ // ===----------------------------------------------------------------------===//
42//
53// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
64// See https://llvm.org/LICENSE.txt for license information.
@@ -24,12 +22,14 @@ using namespace llvm;
2422
2523namespace llvm {
2624class MCObjectTargetWriter ;
27- class XtensaMCAsmBackend : public MCAsmBackend {
25+ }
26+ namespace {
27+ class XtensaAsmBackend : public MCAsmBackend {
2828 uint8_t OSABI;
2929 bool IsLittleEndian;
3030
3131public:
32- XtensaMCAsmBackend (uint8_t osABI, bool isLE)
32+ XtensaAsmBackend (uint8_t osABI, bool isLE)
3333 : MCAsmBackend(llvm::endianness::little), OSABI(osABI),
3434 IsLittleEndian (isLE) {}
3535
@@ -49,9 +49,9 @@ class XtensaMCAsmBackend : public MCAsmBackend {
4949 return createXtensaObjectWriter (OSABI, IsLittleEndian);
5050 }
5151};
52- } // namespace llvm
52+ } // namespace
5353
54- MCFixupKindInfo XtensaMCAsmBackend ::getFixupKindInfo (MCFixupKind Kind) const {
54+ MCFixupKindInfo XtensaAsmBackend ::getFixupKindInfo (MCFixupKind Kind) const {
5555 const static MCFixupKindInfo Infos[Xtensa::NumTargetFixupKinds] = {
5656 // name offset bits flags
5757 {" fixup_xtensa_branch_6" , 0 , 16 , MCFixupKindInfo::FKF_IsPCRel},
@@ -144,11 +144,11 @@ static unsigned getSize(unsigned Kind) {
144144 }
145145}
146146
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 {
152152 MCContext &Ctx = Asm.getContext ();
153153 MCFixupKindInfo Info = getFixupKindInfo (Fixup.getKind ());
154154
@@ -168,16 +168,16 @@ void XtensaMCAsmBackend::applyFixup(const MCAssembler &Asm,
168168 }
169169}
170170
171- bool XtensaMCAsmBackend ::mayNeedRelaxation (const MCInst &Inst,
172- const MCSubtargetInfo &STI) const {
171+ bool XtensaAsmBackend ::mayNeedRelaxation (const MCInst &Inst,
172+ const MCSubtargetInfo &STI) const {
173173 return false ;
174174}
175175
176- void XtensaMCAsmBackend ::relaxInstruction (MCInst &Inst,
177- const MCSubtargetInfo &STI) const {}
176+ void XtensaAsmBackend ::relaxInstruction (MCInst &Inst,
177+ const MCSubtargetInfo &STI) const {}
178178
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 {
181181 uint64_t NumNops24b = Count / 3 ;
182182
183183 for (uint64_t i = 0 ; i != NumNops24b; ++i) {
@@ -210,11 +210,11 @@ bool XtensaMCAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
210210 return true ;
211211}
212212
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) {
217217 uint8_t OSABI =
218218 MCELFObjectTargetWriter::getOSABI (STI.getTargetTriple ().getOS ());
219- return new llvm::XtensaMCAsmBackend (OSABI, true );
219+ return new XtensaAsmBackend (OSABI, true );
220220}
0 commit comments