LLVM API Documentation

HexagonAsmPrinter.h
Go to the documentation of this file.
00001 //===-- HexagonAsmPrinter.h - Print machine code to an Hexagon .s file ----===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // Hexagon Assembly printer class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONASMPRINTER_H
00015 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONASMPRINTER_H
00016 
00017 #include "Hexagon.h"
00018 #include "HexagonTargetMachine.h"
00019 #include "llvm/CodeGen/AsmPrinter.h"
00020 #include "llvm/Support/Compiler.h"
00021 #include "llvm/Support/raw_ostream.h"
00022 
00023 namespace llvm {
00024   class HexagonAsmPrinter : public AsmPrinter {
00025     const HexagonSubtarget *Subtarget;
00026 
00027   public:
00028     explicit HexagonAsmPrinter(TargetMachine &TM, MCStreamer &Streamer)
00029       : AsmPrinter(TM, Streamer) {
00030       Subtarget = &TM.getSubtarget<HexagonSubtarget>();
00031     }
00032 
00033     const char *getPassName() const override {
00034       return "Hexagon Assembly Printer";
00035     }
00036 
00037     bool isBlockOnlyReachableByFallthrough(
00038                                    const MachineBasicBlock *MBB) const override;
00039 
00040     void EmitInstruction(const MachineInstr *MI) override;
00041 
00042     void printOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O);
00043     bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
00044                          unsigned AsmVariant, const char *ExtraCode,
00045                          raw_ostream &OS) override;
00046     bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
00047                                unsigned AsmVariant, const char *ExtraCode,
00048                                raw_ostream &OS) override;
00049 
00050     static const char *getRegisterName(unsigned RegNo);
00051   };
00052 
00053 } // end of llvm namespace
00054 
00055 #endif