Skip to content

Commit ad6fce4

Browse files
committed
[AsmPrinter] Delete dead code; NFC
Delete some snippets that had been commented out since commit a10f592 in release_13x.
1 parent 98de3b5 commit ad6fce4

File tree

3 files changed

+0
-113
lines changed

3 files changed

+0
-113
lines changed

llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,6 @@ class DbgValueLoc {
228228
LLVM_DUMP_METHOD void dump() const {
229229
for (const DbgValueLocEntry &DV : ValueLocEntries)
230230
DV.dump();
231-
// if (isLocation()) {
232-
// llvm::dbgs() << "Loc = { reg=" << Loc.getReg() << " ";
233-
// if (Loc.isIndirect())
234-
// llvm::dbgs() << "+0";
235-
// llvm::dbgs() << "} ";
236-
// } else if (isConstantInt())
237-
// Constant.CIP->dump();
238-
// else if (isConstantFP())
239-
// Constant.CFP->dump();
240231
if (Expression)
241232
Expression->dump();
242233
}
@@ -313,9 +304,6 @@ class DebugLocEntry {
313304
DebugLocStream::ListBuilder &List,
314305
const DIBasicType *BT,
315306
DwarfCompileUnit &TheCU);
316-
317-
// void finalize(const AsmPrinter &AP, DebugLocStream::ListBuilder &List,
318-
// const DIStringType *ST, DwarfCompileUnit &TheCU);
319307
};
320308

321309
/// Compare two DbgValueLocEntries for equality.
@@ -344,29 +332,6 @@ inline bool operator==(const DbgValueLoc &A, const DbgValueLoc &B) {
344332
A.Expression == B.Expression && A.IsVariadic == B.IsVariadic;
345333
}
346334

347-
//inline bool operator==(const DbgValueLoc &A,
348-
// const DbgValueLoc &B) {
349-
// if (A.EntryKind != B.EntryKind)
350-
// return false;
351-
//
352-
// if (A.Expression != B.Expression)
353-
// return false;
354-
//
355-
// switch (A.EntryKind) {
356-
// case DbgValueLoc::E_Location:
357-
// return A.Loc == B.Loc;
358-
// case DbgValueLoc::E_TargetIndexLocation:
359-
// return A.TIL == B.TIL;
360-
// case DbgValueLoc::E_Integer:
361-
// return A.Constant.Int == B.Constant.Int;
362-
// case DbgValueLoc::E_ConstantFP:
363-
// return A.Constant.CFP == B.Constant.CFP;
364-
// case DbgValueLoc::E_ConstantInt:
365-
// return A.Constant.CIP == B.Constant.CIP;
366-
// }
367-
// llvm_unreachable("unhandled EntryKind");
368-
//}
369-
370335
/// Compare two fragments based on their offset.
371336
inline bool operator<(const DbgValueLoc &A,
372337
const DbgValueLoc &B) {

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,28 +1869,10 @@ DbgEntity *DwarfDebug::createConcreteEntity(DwarfCompileUnit &TheCU,
18691869
return ConcreteEntities.back().get();
18701870
}
18711871

1872-
#if 0
1873-
void DwarfDebug::populateDependentTypeMap() {
1874-
for (const auto &I : DbgValues) {
1875-
InlinedEntity IV = I.first;
1876-
if (I.second.empty())
1877-
continue;
1878-
if (const DIVariable *DIV = dyn_cast<DIVariable>(IV.first)) {
1879-
if (const DIStringType *ST = dyn_cast<DIStringType>(
1880-
static_cast<const Metadata *>(DIV->getType())))
1881-
if (const DIVariable *LV = ST->getStringLength())
1882-
VariableInDependentType[LV] = ST;
1883-
}
1884-
}
1885-
}
1886-
#endif
1887-
18881872
// Find variables for each lexical scope.
18891873
void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU,
18901874
const DISubprogram *SP,
18911875
DenseSet<InlinedEntity> &Processed) {
1892-
// clearDependentTracking();
1893-
// populateDependentTypeMap();
18941876
// Grab the variable info that was squirreled away in the MMI side-table.
18951877
collectVariableInfoFromMFTable(TheCU, Processed);
18961878

@@ -1909,11 +1891,6 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU,
19091891

19101892
LexicalScope *Scope = nullptr;
19111893
const DILocalVariable *LocalVar = cast<DILocalVariable>(IV.first);
1912-
#if 0
1913-
const DILocalVariable *LocalVar = dyn_cast<DILocalVariable>(IV.first);
1914-
if (!LocalVar)
1915-
continue;
1916-
#endif
19171894
if (const DILocation *IA = IV.second)
19181895
Scope = LScopes.findInlinedScope(LocalVar->getScope(), IA);
19191896
else
@@ -1972,24 +1949,6 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU,
19721949
// Finalize the entry by lowering it into a DWARF bytestream.
19731950
for (auto &Entry : Entries)
19741951
Entry.finalize(*Asm, List, BT, TheCU);
1975-
#if 0
1976-
List.finalize();
1977-
1978-
if (VariableInDependentType.count(LocalVar)) {
1979-
const DIType *DT = VariableInDependentType[LocalVar];
1980-
if (const DIStringType *ST = dyn_cast<DIStringType>(DT)) {
1981-
unsigned Offset;
1982-
DbgVariable TVar = {LocalVar, IV.second};
1983-
DebugLocStream::ListBuilder LB(DebugLocs, TheCU, *Asm, TVar, *MInsn);
1984-
for (auto &Entry : Entries)
1985-
Entry.finalize(*Asm, LB, ST, TheCU);
1986-
LB.finalize();
1987-
Offset = TVar.getDebugLocListIndex();
1988-
if (Offset != ~0u)
1989-
addStringTypeLoc(ST, Offset);
1990-
}
1991-
}
1992-
#endif
19931952
}
19941953

19951954
// For each InlinedEntity collected from DBG_LABEL instructions, convert to
@@ -2799,35 +2758,6 @@ void DebugLocEntry::finalize(const AsmPrinter &AP,
27992758
List.setTagOffset(*DwarfExpr.TagOffset);
28002759
}
28012760

2802-
#if 0
2803-
inline static DbgValueLoc mkDbgValueLoc(const DIExpression *expr,
2804-
DbgValueLoc &value) {
2805-
if (value.isInt())
2806-
return DbgValueLoc(expr, value.getInt());
2807-
if (value.isLocation())
2808-
return DbgValueLoc(expr, value.getLoc());
2809-
if (value.isConstantInt())
2810-
return DbgValueLoc(expr, value.getConstantInt());
2811-
assert(value.isConstantFP());
2812-
return DbgValueLoc(expr, value.getConstantFP());
2813-
}
2814-
2815-
void DebugLocEntry::finalize(const AsmPrinter &AP,
2816-
DebugLocStream::ListBuilder &List,
2817-
const DIStringType *ST,
2818-
DwarfCompileUnit &TheCU) {
2819-
DebugLocStream::EntryBuilder Entry(List, Begin, End);
2820-
BufferByteStreamer Streamer = Entry.getStreamer();
2821-
DebugLocDwarfExpression DwarfExpr(AP.getDwarfVersion(), Streamer, TheCU);
2822-
DbgValueLoc &Value = Values[0];
2823-
assert(!Value.isFragment());
2824-
assert(Values.size() == 1 && "only fragments may have >1 value");
2825-
Value = mkDbgValueLoc(ST->getStringLengthExp(), Value);
2826-
DwarfDebug::emitDebugLocValue(AP, nullptr, Value, DwarfExpr);
2827-
DwarfExpr.finalize();
2828-
}
2829-
#endif
2830-
28312761
void DwarfDebug::emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry,
28322762
const DwarfCompileUnit *CU) {
28332763
// Emit the size.

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -698,14 +698,6 @@ class DwarfDebug : public DebugHandlerBase {
698698
/// Emit the reference to the section.
699699
void emitSectionReference(const DwarfCompileUnit &CU);
700700

701-
#if 0
702-
/// Populate dependent type variable map
703-
void populateDependentTypeMap();
704-
#endif
705-
706-
/// Clear dependent type tracking map
707-
void clearDependentTracking() { VariableInDependentType.clear(); }
708-
709701
protected:
710702
/// Gather pre-function debug information.
711703
void beginFunctionImpl(const MachineFunction *MF) override;

0 commit comments

Comments
 (0)