LLVM: lib/DebugInfo/LogicalView/Core/LVLine.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
16
17using namespace llvm;
19
20#define DEBUG_TYPE "Line"
21
22namespace {
23const char *const KindBasicBlock = "BasicBlock";
24const char *const KindDiscriminator = "Discriminator";
25const char *const KindEndSequence = "EndSequence";
26const char *const KindEpilogueBegin = "EpilogueBegin";
27const char *const KindLineDebug = "Line";
28const char *const KindLineSource = "Code";
29const char *const KindNewStatement = "NewStatement";
30const char *const KindPrologueEnd = "PrologueEnd";
31const char *const KindUndefined = "Undefined";
32const char *const KindAlwaysStepInto = "AlwaysStepInto";
33const char *const KindNeverStepInto = "NeverStepInto";
34}
35
36
37
38
39
41 const char *Kind = KindUndefined;
42 if (getIsLineDebug())
43 Kind = KindLineDebug;
44 else if (getIsLineAssembler())
45 Kind = KindLineSource;
47}
48
60
61
63 if (options().getInternalNone())
65 return (ShowZero || options().getAttributeZero()) ? (" 0 ")
66 : (" - ");
67}
68
71 if (!(References && Targets))
72 return;
73
75 dbgs() << "\n[LVLine::markMissingParents]\n";
77 dbgs() << "References: "
79 << "Line = " << Reference->getLineNumber() << "\n";
81 dbgs() << "Targets : "
83 << "Line = " << Target->getLineNumber() << "\n";
84 });
85
88 dbgs() << "Search Reference: Line = " << Reference->getLineNumber()
89 << "\n";
90 });
93 }
94}
95
96LVLine *LVLine::findIn(const LVLines *Targets) const {
97 if (!Targets)
98 return nullptr;
99
101 dbgs() << "\n[LVLine::findIn]\n"
102 << "Reference: "
103 << "Level = " << getLevel() << ", "
107 dbgs() << "Target : "
108 << "Level = " << Target->getLevel() << ", "
110 << "Line = " << Target->getLineNumber() << "\n";
111 });
112
116
117 return nullptr;
118}
119
123
125 if (!References && !Targets)
126 return true;
127 if (References && Targets && References->size() == Targets->size()) {
130 return false;
131 return true;
132 }
133 return false;
134}
135
139
141 if (getReader().doPrintLine(this)) {
145 }
146}
147
148
149
150
152
155
156 std::string Separator = Formatted ? " " : "";
157 if (getIsNewStatement()) {
158 Stream << Separator << "{" << KindNewStatement << "}";
159 Separator = " ";
160 }
161 if (getIsDiscriminator()) {
162 Stream << Separator << "{" << KindDiscriminator << "}";
163 Separator = " ";
164 }
165 if (getIsBasicBlock()) {
166 Stream << Separator << "{" << KindBasicBlock << "}";
167 Separator = " ";
168 }
169 if (getIsEndSequence()) {
170 Stream << Separator << "{" << KindEndSequence << "}";
171 Separator = " ";
172 }
173 if (getIsEpilogueBegin()) {
174 Stream << Separator << "{" << KindEpilogueBegin << "}";
175 Separator = " ";
176 }
177 if (getIsPrologueEnd()) {
178 Stream << Separator << "{" << KindPrologueEnd << "}";
179 Separator = " ";
180 }
181 if (getIsAlwaysStepInto()) {
182 Stream << Separator << "{" << KindAlwaysStepInto << "}";
183 Separator = " ";
184 }
185 if (getIsNeverStepInto()) {
186 Stream << Separator << "{" << KindNeverStepInto << "}";
187 Separator = " ";
188 }
189
191}
192
198
201
202 if (options().getAttributeQualifier()) {
203
204
205 OS << statesInfo(true);
207 }
208 OS << "\n";
209}
210
211
212
213
217
Pass interface - Implemented by all 'passes'.
Target - Wrapper for Target specific information.
LLVM_ABI void printItem(LVElement *Element, LVComparePass Pass)
StringRef getName() const override
bool equals(const LVElement *Element) const
size_t getFilenameIndex() const
StringRef getPathname() const
void printExtra(raw_ostream &OS, bool Full=true) const override
Definition LVLine.cpp:218
bool equals(const LVLine *Line) const override
Definition LVLine.cpp:214
bool equals(const LVLine *Line) const override
Definition LVLine.cpp:193
std::string statesInfo(bool Formatted) const
Definition LVLine.cpp:151
void printExtra(raw_ostream &OS, bool Full=true) const override
Definition LVLine.cpp:199
std::string noLineAsString(bool ShowZero=false) const override
Definition LVLine.cpp:62
static void markMissingParents(const LVLines *References, const LVLines *Targets)
Definition LVLine.cpp:69
void printExtra(raw_ostream &OS, bool Full=true) const override
void report(LVComparePass Pass) override
Definition LVLine.cpp:136
const char * kind() const override
Definition LVLine.cpp:40
void print(raw_ostream &OS, bool Full=true) const override
Definition LVLine.cpp:140
virtual bool equals(const LVLine *Line) const
Definition LVLine.cpp:120
virtual void print(raw_ostream &OS, bool Full=true) const
uint32_t getLineNumber() const
virtual std::string noLineAsString(bool ShowZero) const
void incrementPrintedLines()
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
std::map< LVLineKind, LVLineGetFunction > LVLineDispatch
std::string formattedKind(StringRef Kind)
LVScopeCompileUnit * getReaderCompileUnit()
std::string formattedName(StringRef Name)
SmallVector< LVLine *, 8 > LVLines
LVCompare & getComparator()
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.