blob: ab82be3706d8391c0b24ec5da3d547f67548ef00 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- llvm/DebugInfo/Symbolize/DIPrinter.h ---------------------*- C++ -*-===//
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 declares the DIPrinter class, which is responsible for printing
11// structures defined in DebugInfo/DIContext.h
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_DEBUGINFO_SYMBOLIZE_DIPRINTER_H
16#define LLVM_DEBUGINFO_SYMBOLIZE_DIPRINTER_H
17
18#include "llvm/Support/raw_ostream.h"
19
20namespace llvm {
21struct DILineInfo;
22class DIInliningInfo;
23struct DIGlobal;
24
25namespace symbolize {
26
27class DIPrinter {
28 raw_ostream &OS;
29 bool PrintFunctionNames;
30 bool PrintPretty;
31 int PrintSourceContext;
32 bool Verbose;
33
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,
40 bool Verbose = false)
41 : OS(OS), PrintFunctionNames(PrintFunctionNames),
42 PrintPretty(PrintPretty), PrintSourceContext(PrintSourceContext),
43 Verbose(Verbose) {}
44
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