3939
4040#define DEBUG_TYPE " avr-asm-printer"
4141
42- namespace llvm {
42+ using namespace llvm ;
43+
44+ namespace {
4345
4446// / An AVR assembly code printer.
4547class AVRAsmPrinter : public AsmPrinter {
4648public:
4749 AVRAsmPrinter (TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer)
48- : AsmPrinter(TM, std::move(Streamer)), MRI(*TM.getMCRegisterInfo()) {}
50+ : AsmPrinter(TM, std::move(Streamer), ID ), MRI(*TM.getMCRegisterInfo()) {}
4951
5052 StringRef getPassName () const override { return " AVR Assembly Printer" ; }
5153
@@ -68,11 +70,15 @@ class AVRAsmPrinter : public AsmPrinter {
6870
6971 void emitStartOfAsmFile (Module &M) override ;
7072
73+ static char ID;
74+
7175private:
7276 const MCRegisterInfo &MRI;
7377 bool EmittedStructorSymbolAttrs = false ;
7478};
7579
80+ } // namespace
81+
7682void AVRAsmPrinter::printOperand (const MachineInstr *MI, unsigned OpNo,
7783 raw_ostream &O) {
7884 const MachineOperand &MO = MI->getOperand (OpNo);
@@ -324,8 +330,11 @@ void AVRAsmPrinter::emitStartOfAsmFile(Module &M) {
324330 MCConstantExpr::create (SubTM->getIORegRAMPZ (), MMI->getContext ()));
325331}
326332
327- } // end of namespace llvm
333+ char AVRAsmPrinter::ID = 0 ;
334+
335+ INITIALIZE_PASS (AVRAsmPrinter, " avr-asm-printer" , " AVR Assembly Printer" ,
336+ false , false )
328337
329338extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRAsmPrinter() {
330- llvm::RegisterAsmPrinter<llvm:: AVRAsmPrinter> X (llvm:: getTheAVRTarget ());
339+ llvm::RegisterAsmPrinter<AVRAsmPrinter> X (getTheAVRTarget ());
331340}
0 commit comments