Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | //===- llvm/DebugInfo/Symbolize/DIPrinter.h ---------------------*- C++ -*-===// |
| 2 | // |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame^] | 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 |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 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 | |
| 17 | #include "llvm/Support/raw_ostream.h" |
| 18 | |
| 19 | namespace llvm { |
| 20 | struct DILineInfo; |
| 21 | class DIInliningInfo; |
| 22 | struct DIGlobal; |
| 23 | |
| 24 | namespace symbolize { |
| 25 | |
| 26 | class DIPrinter { |
| 27 | raw_ostream &OS; |
| 28 | bool PrintFunctionNames; |
| 29 | bool PrintPretty; |
| 30 | int PrintSourceContext; |
| 31 | bool Verbose; |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame^] | 32 | bool Basenames; |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 33 | |
| 34 | void print(const DILineInfo &Info, bool Inlined); |
| 35 | void printContext(const std::string &FileName, int64_t Line); |
| 36 | |
| 37 | public: |
| 38 | DIPrinter(raw_ostream &OS, bool PrintFunctionNames = true, |
| 39 | bool PrintPretty = false, int PrintSourceContext = 0, |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame^] | 40 | bool Verbose = false, bool Basenames = false) |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 41 | : OS(OS), PrintFunctionNames(PrintFunctionNames), |
| 42 | PrintPretty(PrintPretty), PrintSourceContext(PrintSourceContext), |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame^] | 43 | Verbose(Verbose), Basenames(Basenames) {} |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 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 | |