39 void DIPrinter::printContext(
const std::string &FileName, int64_t Line) {
40 if (PrintSourceContext <= 0)
48 std::unique_ptr<MemoryBuffer> Buf = std::move(BufOrErr.
get());
50 std::max(static_cast<int64_t>(1), Line - PrintSourceContext / 2);
51 int64_t LastLine = FirstLine + PrintSourceContext;
55 !
I.is_at_eof() &&
I.line_number() <= LastLine; ++
I) {
56 int64_t L =
I.line_number();
57 if (L >= FirstLine && L <= LastLine) {
69 if (PrintFunctionNames) {
71 if (FunctionName == kDILineInfoBadString)
74 StringRef Delimiter = PrintPretty ?
" at " :
"\n";
76 OS << Prefix << FunctionName << Delimiter;
78 std::string Filename = Info.
FileName;
79 if (Filename == kDILineInfoBadString)
82 OS << Filename <<
":" << Info.
Line <<
":" << Info.
Column <<
"\n";
83 printContext(Filename, Info.
Line);
86 OS <<
" Filename: " << Filename <<
"\n";
88 OS <<
"Function start line: " << Info.
StartLine <<
"\n";
89 OS <<
" Line: " << Info.
Line <<
"\n";
90 OS <<
" Column: " << Info.
Column <<
"\n";
102 if (FramesNum == 0) {
106 for (
uint32_t i = 0; i < FramesNum; i++)
113 if (Name == kDILineInfoBadString)
116 OS << Global.
Start <<
" " << Global.
Size <<
"\n";
Represents either an error or a value T.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
This class represents lattice values for constants.
A forward iterator which reads text lines from a buffer.
DIPrinter & operator<<(const DILineInfo &Info)
A format-neutral container for source line information.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
uint32_t getNumberOfFrames() const
Analysis containing CSE Info
A format-neutral container for inlined code description.
static const char kBadString[]
FormattedNumber format_decimal(int64_t N, unsigned Width)
format_decimal - Output N as a right justified, fixed-width decimal.
static const char kDILineInfoBadString[]
Provides ErrorOr<T> smart pointer.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatile=false)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful, otherwise returning null.
const DILineInfo & getFrame(unsigned Index) const
StringRef - Represent a constant reference to a string, i.e.
Container for description of a global variable.