LLVM  10.0.0svn
DIPrinter.h
Go to the documentation of this file.
1 //===- llvm/DebugInfo/Symbolize/DIPrinter.h ---------------------*- 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 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 
18 
19 namespace llvm {
20 struct DILineInfo;
21 class DIInliningInfo;
22 struct DIGlobal;
23 struct DILocal;
24 
25 namespace symbolize {
26 
27 class DIPrinter {
28 public:
29  enum class OutputStyle { LLVM, GNU };
30 
31 private:
32  raw_ostream &OS;
33  bool PrintFunctionNames;
34  bool PrintPretty;
35  int PrintSourceContext;
36  bool Verbose;
37  bool Basenames;
38  OutputStyle Style;
39 
40  void print(const DILineInfo &Info, bool Inlined);
41  void printContext(const std::string &FileName, int64_t Line);
42 
43 public:
44  DIPrinter(raw_ostream &OS, bool PrintFunctionNames = true,
45  bool PrintPretty = false, int PrintSourceContext = 0,
46  bool Verbose = false, bool Basenames = false,
48  : OS(OS), PrintFunctionNames(PrintFunctionNames),
49  PrintPretty(PrintPretty), PrintSourceContext(PrintSourceContext),
50  Verbose(Verbose), Basenames(Basenames), Style(Style) {}
51 
52  DIPrinter &operator<<(const DILineInfo &Info);
53  DIPrinter &operator<<(const DIInliningInfo &Info);
54  DIPrinter &operator<<(const DIGlobal &Global);
55  DIPrinter &operator<<(const DILocal &Local);
56 };
57 }
58 }
59 
60 #endif
61 
This class represents lattice values for constants.
Definition: AllocatorList.h:23
DIPrinter & operator<<(const DILineInfo &Info)
Definition: DIPrinter.cpp:95
A format-neutral container for source line information.
Definition: DIContext.h:30
Analysis containing CSE Info
Definition: CSEInfo.cpp:20
A format-neutral container for inlined code description.
Definition: DIContext.h:81
DIPrinter(raw_ostream &OS, bool PrintFunctionNames=true, bool PrintPretty=false, int PrintSourceContext=0, bool Verbose=false, bool Basenames=false, OutputStyle Style=OutputStyle::LLVM)
Definition: DIPrinter.h:44
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
Container for description of a global variable.
Definition: DIContext.h:111