/// processLocation - Process DILocation. void DebugInfoFinder::processLocation(DILocation Loc) { if (!Loc.Verify()) return; DIDescriptor S(Loc.getScope()); if (S.isCompileUnit()) addCompileUnit(DICompileUnit(S)); else if (S.isSubprogram()) processSubprogram(DISubprogram(S)); else if (S.isLexicalBlock()) processLexicalBlock(DILexicalBlock(S)); processLocation(Loc.getOrigLocation()); }
static MDNode *UpdateInlinedAtInfo(MDNode *InsnMD, MDNode *TheCallMD) { DILocation ILoc(InsnMD); if (!ILoc.Verify()) return InsnMD; DILocation CallLoc(TheCallMD); if (!CallLoc.Verify()) return InsnMD; DILocation OrigLocation = ILoc.getOrigLocation(); MDNode *NewLoc = TheCallMD; if (OrigLocation.Verify()) NewLoc = UpdateInlinedAtInfo(OrigLocation, TheCallMD); Value *MDVs[] = { InsnMD->getOperand(0), // Line InsnMD->getOperand(1), // Col InsnMD->getOperand(2), // Scope NewLoc }; return MDNode::get(InsnMD->getContext(), MDVs, 4); }