blob: 71663f30a59ff6314e277f9537ed9dfd4b3fd03a [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- llvm/DebugInfo/Symbolize/DIPrinter.h ---------------------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the DIPrinter class, which is responsible for printing
10// structures defined in DebugInfo/DIContext.h
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_DEBUGINFO_SYMBOLIZE_DIPRINTER_H
15#define LLVM_DEBUGINFO_SYMBOLIZE_DIPRINTER_H
16
17#include "llvm/Support/raw_ostream.h"
18
19namespace llvm {
20struct DILineInfo;
21class DIInliningInfo;
22struct DIGlobal;
23
24namespace symbolize {
25
26class DIPrinter {
27 raw_ostream &OS;
28 bool PrintFunctionNames;
29 bool PrintPretty;
30 int PrintSourceContext;
31 bool Verbose;
Andrew Walbran16937d02019-10-22 13:54:20 +010032 bool Basenames;
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010033
34 void print(const DILineInfo &Info, bool Inlined);
35 void printContext(const std::string &FileName, int64_t Line);
36
37public:
38 DIPrinter(raw_ostream &OS, bool PrintFunctionNames = true,
39 bool PrintPretty = false, int PrintSourceContext = 0,
Andrew Walbran16937d02019-10-22 13:54:20 +010040 bool Verbose = false, bool Basenames = false)
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010041 : OS(OS), PrintFunctionNames(PrintFunctionNames),
42 PrintPretty(PrintPretty), PrintSourceContext(PrintSourceContext),
Andrew Walbran16937d02019-10-22 13:54:20 +010043 Verbose(Verbose), Basenames(Basenames) {}
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010044
45 DIPrinter &operator<<(const DILineInfo &Info);
46 DIPrinter &operator<<(const DIInliningInfo &Info);
47 DIPrinter &operator<<(const DIGlobal &Global);
48};
49}
50}
51
52#endif
53