================
@@ -4978,6 +4978,24 @@ void CGDebugInfo::EmitFunctionDecl(GlobalDecl GD,
SourceLocation Loc,
Fn->setSubprogram(SP);
}
+void CGDebugInfo::addCallTarget(const FunctionDecl *FD, llvm::CallBase *CI) {
+ if (!generateVirtualCallSite())
+ return;
+
+ if (!FD)
+ return;
+
+ // Record only indirect calls.
+ assert(CI && "Invalid Call Instruction.");
+ if (!CI->isIndirectCall())
+ return;
+
+ // Always get method definition.
+ if (llvm::DISubprogram *MD = getFunctionDeclaration(FD))
+ // Attach the target metadata
----------------
felipepiovezan wrote:
NIT: are these two comments adding anything to the code? The first one seems
more confusing than clarifying (it says "definition" but then the line below is
"get declaration"). The second comment is just restating what the
`CI->setMetadata` words already state.
https://github.com/llvm/llvm-project/pull/167666
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits