1//===- bolt/Core/BinaryEmitter.h - Emit code and data -----------*- C++ -*-===//
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 contains declarations of functions for emitting code and data into
10// a binary file.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef BOLT_CORE_BINARY_EMITTER_H
15#define BOLT_CORE_BINARY_EMITTER_H
16
17#include "llvm/ADT/StringRef.h"
18
19namespace llvm {
20class MCStreamer;
21
22namespace bolt {
23class BinaryContext;
24class BinaryFunction;
25class FunctionFragment;
26
27/// Emit all code and data from the BinaryContext \p BC into the \p Streamer.
28///
29/// \p OrgSecPrefix is used to modify name of emitted original sections
30/// contained in \p BC. This is done to distinguish them from sections emitted
31/// by LLVM backend.
32void emitBinaryContext(MCStreamer &Streamer, BinaryContext &BC,
33 StringRef OrgSecPrefix = "");
34
35/// Emit \p BF function code. The caller is responsible for emitting function
36/// symbol(s) and setting the section to emit the code to.
37void emitFunctionBody(MCStreamer &Streamer, BinaryFunction &BF,
38 FunctionFragment &FF, bool EmitCodeOnly);
39
40} // namespace bolt
41} // namespace llvm
42
43#endif
44

source code of bolt/include/bolt/Core/BinaryEmitter.h