Commit 525244ae authored by pratik ashar's avatar pratik ashar Committed by gbsbuild

Emit is_stmt attribute only for 1st

combination of line, inlinedAt

Change-Id: I322fbcd6bd2a7091175d484b1050d595484548a1
parent 7fccecbf
......@@ -1202,7 +1202,33 @@ void DwarfDebug::beginInstruction(const Instruction *MI, bool recordSrcLine)
}
if (!PrologEndLoc)
{
Flags |= DWARF2_FLAG_IS_STMT;
bool setIsStmt = true;
auto line = DL.getLine();
auto inlinedAt = DL.getInlinedAt();
auto it = isStmtSet.find(line);
if (it != isStmtSet.end())
{
// is_stmt is set only if line#,
// inlinedAt combination is
// never seen before.
auto& iat = (*it).second;
for (auto& item : iat)
{
if (item == inlinedAt)
{
setIsStmt = false;
break;
}
}
}
if (setIsStmt)
{
Flags |= DWARF2_FLAG_IS_STMT;
isStmtSet[line].push_back(inlinedAt);
}
}
const MDNode *Scope = DL.getScope();
......
......@@ -571,6 +571,9 @@ namespace IGC
void gatherDISubprogramNodes();
// line#, vector<inlinedAt>
std::map<unsigned int, std::vector<llvm::DILocation*>> isStmtSet;
public:
std::map<llvm::DISubprogram*, const llvm::Function*>* getDISPToFunction()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment