LLVM API Documentation

SparcTargetStreamer.cpp
Go to the documentation of this file.
00001 //===-- SparcTargetStreamer.cpp - Sparc Target Streamer Methods -----------===//
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 // This file provides Sparc specific target streamer methods.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "SparcTargetStreamer.h"
00015 #include "InstPrinter/SparcInstPrinter.h"
00016 #include "llvm/Support/FormattedStream.h"
00017 
00018 using namespace llvm;
00019 
00020 // pin vtable to this file
00021 SparcTargetStreamer::SparcTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
00022 
00023 void SparcTargetStreamer::anchor() {}
00024 
00025 SparcTargetAsmStreamer::SparcTargetAsmStreamer(MCStreamer &S,
00026                                                formatted_raw_ostream &OS)
00027     : SparcTargetStreamer(S), OS(OS) {}
00028 
00029 void SparcTargetAsmStreamer::emitSparcRegisterIgnore(unsigned reg) {
00030   OS << "\t.register "
00031      << "%" << StringRef(SparcInstPrinter::getRegisterName(reg)).lower()
00032      << ", #ignore\n";
00033 }
00034 
00035 void SparcTargetAsmStreamer::emitSparcRegisterScratch(unsigned reg) {
00036   OS << "\t.register "
00037      << "%" << StringRef(SparcInstPrinter::getRegisterName(reg)).lower()
00038      << ", #scratch\n";
00039 }
00040 
00041 SparcTargetELFStreamer::SparcTargetELFStreamer(MCStreamer &S)
00042     : SparcTargetStreamer(S) {}
00043 
00044 MCELFStreamer &SparcTargetELFStreamer::getStreamer() {
00045   return static_cast<MCELFStreamer &>(Streamer);
00046 }