1 //===- llvm/DebugInfo/Symbolize/DIPrinter.h ---------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file declares the DIPrinter class, which is responsible for printing
10 // structures defined in DebugInfo/DIContext.h
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_DEBUGINFO_SYMBOLIZE_DIPRINTER_H
15 #define LLVM_DEBUGINFO_SYMBOLIZE_DIPRINTER_H
17 #include "llvm/Support/raw_ostream.h"
29 enum class OutputStyle
{ LLVM
, GNU
};
33 bool PrintFunctionNames
;
35 int PrintSourceContext
;
40 void print(const DILineInfo
&Info
, bool Inlined
);
41 void printContext(const std::string
&FileName
, int64_t Line
);
44 DIPrinter(raw_ostream
&OS
, bool PrintFunctionNames
= true,
45 bool PrintPretty
= false, int PrintSourceContext
= 0,
46 bool Verbose
= false, bool Basenames
= false,
47 OutputStyle Style
= OutputStyle::LLVM
)
48 : OS(OS
), PrintFunctionNames(PrintFunctionNames
),
49 PrintPretty(PrintPretty
), PrintSourceContext(PrintSourceContext
),
50 Verbose(Verbose
), Basenames(Basenames
), Style(Style
) {}
52 DIPrinter
&operator<<(const DILineInfo
&Info
);
53 DIPrinter
&operator<<(const DIInliningInfo
&Info
);
54 DIPrinter
&operator<<(const DIGlobal
&Global
);
55 DIPrinter
&operator<<(const DILocal
&Local
);