Index: llvm/tools/llvm-dwarfdump/Statistics.cpp =================================================================== --- llvm/tools/llvm-dwarfdump/Statistics.cpp +++ llvm/tools/llvm-dwarfdump/Statistics.cpp @@ -448,6 +448,10 @@ InlinedVarsTyMap &GlobalInlinedFnInfo, InlinedFnInstacesTy &InlinedFnsToBeProcessed, InlinedVarsTy *InlinedVarsPtr = nullptr) { + // Skip NULL nodes. + if (Die.isNULL()) + return; + const dwarf::Tag Tag = Die.getTag(); // Skip function types. if (Tag == dwarf::DW_TAG_subroutine_type) @@ -537,7 +541,7 @@ else if (IsInlinedFunction && InlineDepth == 0) GlobalStats.InlineFunctionSize += BytesInThisScope; } - } else { + } else if (Tag != dwarf::DW_TAG_compile_unit) { // Not a scope, visit the Die itself. It could be a variable. collectStatsForDie(Die, FnPrefix, VarPrefix, BytesInScope, InlineDepth, FnStatMap, GlobalStats, LocStats, InlinedVarsPtr);