//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "dwarfdebug"
-
#include "ByteStreamer.h"
#include "DIEHash.h"
#include "DIE.h"
using namespace llvm;
+#define DEBUG_TYPE "dwarfdebug"
+
/// \brief Grabs the string in whichever attribute is passed in and returns
/// a reference to it.
static StringRef getDIEStringAttr(const DIE &Die, uint16_t Attr) {
// Hash the contents of a loclistptr class.
void DIEHash::hashLocList(const DIELocList &LocList) {
HashingByteStreamer Streamer(*this);
+ DwarfDebug &DD = *AP->getDwarfDebug();
for (const auto &Entry :
- AP->getDwarfDebug()->getDebugLocEntries()[LocList.getValue()])
- AP->getDwarfDebug()->emitDebugLocEntry(Streamer, Entry);
+ DD.getDebugLocEntries()[LocList.getValue()].List)
+ DD.emitDebugLocEntry(Streamer, Entry);
}
// Hash an individual attribute \param Attr based on the type of attribute and
// ... An attribute that refers to another type entry T is processed as
// follows:
case DIEValue::isEntry:
- hashDIEEntry(Attribute, Tag, *cast<DIEEntry>(Value)->getEntry());
+ hashDIEEntry(Attribute, Tag, cast<DIEEntry>(Value)->getEntry());
break;
case DIEValue::isInteger: {
addULEB128('A');
addAttributes(Die);
// Then hash each of the children of the DIE.
- for (std::vector<DIE *>::const_iterator I = Die.getChildren().begin(),
- E = Die.getChildren().end();
- I != E; ++I) {
+ for (auto &C : Die.getChildren()) {
// 7.27 Step 7
// If C is a nested type entry or a member function entry, ...
- if (isType((*I)->getTag()) || (*I)->getTag() == dwarf::DW_TAG_subprogram) {
- StringRef Name = getDIEStringAttr(**I, dwarf::DW_AT_name);
+ if (isType(C->getTag()) || C->getTag() == dwarf::DW_TAG_subprogram) {
+ StringRef Name = getDIEStringAttr(*C, dwarf::DW_AT_name);
// ... and has a DW_AT_name attribute
if (!Name.empty()) {
- hashNestedType(**I, Name);
+ hashNestedType(*C, Name);
continue;
}
}
- computeHash(**I);
+ computeHash(*C);
}
// Following the last (or if there are no children), append a zero byte.