1 //===-- AVRTargetStreamer.cpp - AVR Target Streamer Methods ---------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file provides AVR specific target streamer methods.
12 //===----------------------------------------------------------------------===//
14 #include "AVRTargetStreamer.h"
16 #include "llvm/MC/MCContext.h"
20 AVRTargetStreamer::AVRTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
22 AVRTargetAsmStreamer::AVRTargetAsmStreamer(MCStreamer &S)
23 : AVRTargetStreamer(S) {}
25 void AVRTargetStreamer::finish() {
26 MCStreamer &OS = getStreamer();
27 MCContext &Context = OS.getContext();
29 MCSymbol *DoCopyData = Context.getOrCreateSymbol("__do_copy_data");
30 MCSymbol *DoClearBss = Context.getOrCreateSymbol("__do_clear_bss");
32 // FIXME: We can disable __do_copy_data if there are no static RAM variables.
34 OS.emitRawComment(" Declaring this symbol tells the CRT that it should");
35 OS.emitRawComment("copy all variables from program memory to RAM on startup");
36 OS.EmitSymbolAttribute(DoCopyData, MCSA_Global);
38 OS.emitRawComment(" Declaring this symbol tells the CRT that it should");
39 OS.emitRawComment("clear the zeroed data section on startup");
40 OS.EmitSymbolAttribute(DoClearBss, MCSA_Global);
43 } // end namespace llvm