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