[PATCH] D60713: [IR] Add DISuprogram and DIE for func decl of an external
Djordje Todorovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 30 06:41:29 PDT 2019
djtodoro added a comment.
> I'm sorry if the answer to that question is already in your reply and I just failed to parse it: Why do we need the DISPFlagDeclForCallSite *flag* to differentiate the a DISubprogram. Isn't the fact that it is attached to a forward-declaration enough?
We could avoid the flag, but since existing LLVM infrastructure does not allow debug info for function declarations itself, we wanted to emphasize that we are creating it only for the purpose of call site’s debug info. The verifier to distinguish that the declaration will be used in that purpose uses the flag.
> Secondly: since this is attached to a forward *declaration*, would it make sense to attach the unique (= not distinct) DISubprogram from the type hierarchy instead of creating another distinct node?
Oh, the test case from this patch was artificial one. We are actually creating it that way. There is no `distinct` subprograms for the declarations. Please see the test case updated.
> What is the intended behavior when two LLVM modules containing the same forward declaration are llvm-linked during LTO?
LLVM linked file will have just one debug info subprogram instance for the declaration.
CHANGES SINCE LAST ACTION
More information about the llvm-commits