[AsmPrinter] Prune dead code. NFC.

I left all (dead) print and dump methods in place.

llvm-svn: 250433
This commit is contained in:
Benjamin Kramer 2015-10-15 17:16:32 +00:00
parent d9189ceb23
commit 7fa42c8a8c
7 changed files with 0 additions and 114 deletions

View File

@ -414,9 +414,6 @@ public:
void EmitULEB128(uint64_t Value, const char *Desc = nullptr,
unsigned PadTo = 0) const;
/// Emit a .byte 42 directive for a DW_CFA_xxx value.
void EmitCFAByte(unsigned Val) const;
/// Emit a .byte 42 directive that corresponds to an encoding. If verbose
/// assembly output is enabled, we output comments describing the encoding.
/// Desc is a string saying what the encoding is specifying (e.g. "LSDA").

View File

@ -56,18 +56,6 @@ void AsmPrinter::EmitULEB128(uint64_t Value, const char *Desc,
OutStreamer->EmitULEB128IntValue(Value, PadTo);
}
/// EmitCFAByte - Emit a .byte 42 directive for a DW_CFA_xxx value.
void AsmPrinter::EmitCFAByte(unsigned Val) const {
if (isVerbose()) {
if (Val >= dwarf::DW_CFA_offset && Val < dwarf::DW_CFA_offset + 64)
OutStreamer->AddComment("DW_CFA_offset + Reg (" +
Twine(Val - dwarf::DW_CFA_offset) + ")");
else
OutStreamer->AddComment(dwarf::CallFrameString(Val));
}
OutStreamer->EmitIntValue(Val, 1);
}
static const char *DecodeDWARFEncoding(unsigned Encoding) {
switch (Encoding) {
case dwarf::DW_EH_PE_absptr:

View File

@ -469,38 +469,6 @@ void DIEHash::computeHash(const DIE &Die) {
Hash.update(makeArrayRef((uint8_t)'\0'));
}
/// This is based on the type signature computation given in section 7.27 of the
/// DWARF4 standard. It is the md5 hash of a flattened description of the DIE
/// with the exception that we are hashing only the context and the name of the
/// type.
uint64_t DIEHash::computeDIEODRSignature(const DIE &Die) {
// Add the contexts to the hash. We won't be computing the ODR hash for
// function local types so it's safe to use the generic context hashing
// algorithm here.
// FIXME: If we figure out how to account for linkage in some way we could
// actually do this with a slight modification to the parent hash algorithm.
if (const DIE *Parent = Die.getParent())
addParentContext(*Parent);
// Add the current DIE information.
// Add the DWARF tag of the DIE.
addULEB128(Die.getTag());
// Add the name of the type to the hash.
addString(getDIEStringAttr(Die, dwarf::DW_AT_name));
// Now get the result.
MD5::MD5Result Result;
Hash.final(Result);
// ... take the least significant 8 bytes and return those. Our MD5
// implementation always returns its results in little endian, swap bytes
// appropriately.
return support::endian::read64le(Result + 8);
}
/// This is based on the type signature computation given in section 7.27 of the
/// DWARF4 standard. It is an md5 hash of the flattened description of the DIE
/// with the inclusion of the full CU and all top level CU entities.

View File

@ -84,9 +84,6 @@ class DIEHash {
public:
DIEHash(AsmPrinter *A = nullptr) : AP(A) {}
/// \brief Computes the ODR signature.
uint64_t computeDIEODRSignature(const DIE &Die);
/// \brief Computes the CU signature.
uint64_t computeCUSignature(const DIE &Die);

View File

@ -214,7 +214,6 @@ static LLVM_CONSTEXPR DwarfAccelTable::Atom TypeAtoms[] = {
DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
: Asm(A), MMI(Asm->MMI), DebugLocs(A->OutStreamer->isVerboseAsm()),
PrevLabel(nullptr), InfoHolder(A, "info_string", DIEValueAllocator),
UsedNonDefaultText(false),
SkeletonHolder(A, "skel_string", DIEValueAllocator),
IsDarwin(Triple(A->getTargetTriple()).isOSDarwin()),
AccelNames(DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset,
@ -343,18 +342,6 @@ void DwarfDebug::addSubprogramNames(const DISubprogram *SP, DIE &Die) {
}
}
/// isSubprogramContext - Return true if Context is either a subprogram
/// or another context nested inside a subprogram.
bool DwarfDebug::isSubprogramContext(const MDNode *Context) {
if (!Context)
return false;
if (isa<DISubprogram>(Context))
return true;
if (auto *T = dyn_cast<DIType>(Context))
return isSubprogramContext(resolve(T->getScope()));
return false;
}
/// Check whether we should create a DIE for the given Scope, return true
/// if we don't create a DIE (the corresponding DIE is null).
bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) {

View File

@ -48,24 +48,6 @@ class DwarfTypeUnit;
class DwarfUnit;
class MachineModuleInfo;
//===----------------------------------------------------------------------===//
/// This class is used to record source line correspondence.
class SrcLineInfo {
unsigned Line; // Source line number.
unsigned Column; // Source column.
unsigned SourceID; // Source ID number.
MCSymbol *Label; // Label in code ID number.
public:
SrcLineInfo(unsigned L, unsigned C, unsigned S, MCSymbol *label)
: Line(L), Column(C), SourceID(S), Label(label) {}
// Accessors
unsigned getLine() const { return Line; }
unsigned getColumn() const { return Column; }
unsigned getSourceID() const { return SourceID; }
MCSymbol *getLabel() const { return Label; }
};
//===----------------------------------------------------------------------===//
/// This class is used to track local variable information.
///
@ -323,13 +305,6 @@ class DwarfDebug : public AsmPrinterHandler {
/// Whether to emit the pubnames/pubtypes sections.
bool HasDwarfPubSections;
/// Whether or not to use AT_ranges for compilation units.
bool HasCURanges;
/// Whether we emitted a function into a section other than the
/// default text.
bool UsedNonDefaultText;
/// Whether to use the GNU TLS opcode (instead of the standard opcode).
bool UseGNUTLSOpcode;
@ -402,12 +377,6 @@ class DwarfDebug : public AsmPrinterHandler {
/// Construct a DIE for this abstract scope.
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
/// Compute the size and offset of a DIE given an incoming Offset.
unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
/// Compute the size and offset of all the DIEs.
void computeSizeAndOffsets();
/// Collect info for variables that were optimized out.
void collectDeadVariables();
@ -473,9 +442,6 @@ class DwarfDebug : public AsmPrinterHandler {
/// Emit visible names into a debug ranges section.
void emitDebugRanges();
/// Emit inline info using custom format.
void emitDebugInlineInfo();
/// DWARF 5 Experimental Split Dwarf Emitters
/// Initialize common features of skeleton units.
@ -486,10 +452,6 @@ class DwarfDebug : public AsmPrinterHandler {
/// section.
DwarfCompileUnit &constructSkeletonCU(const DwarfCompileUnit &CU);
/// Construct the split debug info compile unit for the debug info
/// section.
DwarfTypeUnit &constructSkeletonTU(DwarfTypeUnit &TU);
/// Emit the debug info dwo section.
void emitDebugInfoDWO();
@ -649,9 +611,6 @@ public:
DwarfCompileUnit *lookupUnit(const DIE *CU) const {
return CUDieMap.lookup(CU);
}
/// isSubprogramContext - Return true if Context is either a subprogram
/// or another context nested inside a subprogram.
bool isSubprogramContext(const MDNode *Context);
void addSubprogramNames(const DISubprogram *SP, DIE &Die);

View File

@ -113,13 +113,6 @@ protected:
DwarfUnit(unsigned UID, dwarf::Tag, const DICompileUnit *CU, AsmPrinter *A,
DwarfDebug *DW, DwarfFile *DWU);
/// Add a string attribute data and value.
///
/// This is guaranteed to be in the local string pool instead of indirected.
void addLocalString(DIE &Die, dwarf::Attribute Attribute, StringRef Str);
void addIndexedString(DIE &Die, dwarf::Attribute Attribute, StringRef Str);
bool applySubprogramDefinitionAttributes(const DISubprogram *SP, DIE &SPDie);
public:
@ -162,9 +155,6 @@ public:
virtual void addGlobalType(const DIType *Ty, const DIE &Die,
const DIScope *Context) {}
/// Add a new name to the namespace accelerator table.
void addAccelNamespace(StringRef Name, const DIE &Die);
/// Returns the DIE map slot for the specified debug variable.
///
/// We delegate the request to DwarfDebug when the MDNode can be part of the