aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/MIR/MIPrinter.h
blob: 663859e6d7b75895562f8e943a53feb7ab4d746d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef RCC_MIR_MIPRINTER_H
#define RCC_MIR_MIPRINTER_H

#include "rcc/MIR/MIParser.h"
#include "rcc/Support/Error.h"

#include <string>

namespace rcc {

class MachineFunction;
class TargetDescription;

namespace mir {

enum class MIPrintMode : unsigned char {
  Complete,
  Readable,
};

struct MIPrinterOptions final {
  MIPrintMode Mode = MIPrintMode::Complete;
};

[[nodiscard]] Expected<std::string> printMachineFunctionBody(const MachineFunction &Function,
                                                             const TargetDescription &Target,
                                                             const MIParserContext &Context = {},
                                                             MIPrinterOptions Options = {});

} // namespace mir
} // namespace rcc

#endif // RCC_MIR_MIPRINTER_H