Recommit r373598 "[yaml2obj/obj2yaml] - Add support for SHT_LLVM_ADDRSIG sections."
[llvm-complete.git] / lib / Target / AVR / MCTargetDesc / AVRTargetStreamer.cpp
blob3487a2bbb8640bf3e6f11e11c7cbcf291e59f4f0
1 //===-- AVRTargetStreamer.cpp - AVR Target Streamer Methods ---------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides AVR specific target streamer methods.
11 //===----------------------------------------------------------------------===//
13 #include "AVRTargetStreamer.h"
15 #include "llvm/MC/MCContext.h"
17 namespace llvm {
19 AVRTargetStreamer::AVRTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
21 AVRTargetAsmStreamer::AVRTargetAsmStreamer(MCStreamer &S)
22 : AVRTargetStreamer(S) {}
24 void AVRTargetStreamer::finish() {
25 MCStreamer &OS = getStreamer();
26 MCContext &Context = OS.getContext();
28 MCSymbol *DoCopyData = Context.getOrCreateSymbol("__do_copy_data");
29 MCSymbol *DoClearBss = Context.getOrCreateSymbol("__do_clear_bss");
31 // FIXME: We can disable __do_copy_data if there are no static RAM variables.
33 OS.emitRawComment(" Declaring this symbol tells the CRT that it should");
34 OS.emitRawComment("copy all variables from program memory to RAM on startup");
35 OS.EmitSymbolAttribute(DoCopyData, MCSA_Global);
37 OS.emitRawComment(" Declaring this symbol tells the CRT that it should");
38 OS.emitRawComment("clear the zeroed data section on startup");
39 OS.EmitSymbolAttribute(DoClearBss, MCSA_Global);
42 } // end namespace llvm