#define DEBUG_TYPE "dwarfdebug"
-#include "DIE.h"
#include "DIEHash.h"
-#include "DwarfCompileUnit.h"
+
+#include "DIE.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Debug.h"
// outermost such construct...
SmallVector<const DIE *, 1> Parents;
const DIE *Cur = &Parent;
- while (Cur->getTag() != dwarf::DW_TAG_compile_unit) {
+ while (Cur->getParent()) {
Parents.push_back(Cur);
Cur = Cur->getParent();
}
+ assert(Cur->getTag() == dwarf::DW_TAG_compile_unit ||
+ Cur->getTag() == dwarf::DW_TAG_type_unit);
// Reverse iterate over our list to go from the outermost construct to the
// innermost.
I != E; ++I) {
// 7.27 Step 7
// If C is a nested type entry or a member function entry, ...
- if (isType((*I)->getTag())) {
+ if (isType((*I)->getTag()) || (*I)->getTag() == dwarf::DW_TAG_subprogram) {
StringRef Name = getDIEStringAttr(**I, dwarf::DW_AT_name);
// ... and has a DW_AT_name attribute
if (!Name.empty()) {