probinson added a comment.

Trying to understand the broader context here, I looked back through the list 
of revisions mentioned in PR33930 to see if that helped.

When called on a method, CodeGenModule::EmitGlobalDefinition() calls 
CodeGenModule::EmitGlobalFunctionDefinition(), which in turn calls 
CodeGenFunction::GenerateCode(), which calls CodeGenFunction::FinishFunction(), 
which calls CGDebugInfo::EmitFunctionEnd(), which calls 
DIBuilder::finalizeSubprogram().  This is supposed to finalize the metadata for 
the subprogram.
If the method is virtual, EmitGlobalDefinition() then calls 
getVTables().EmitThunks() which eventually gets to GenerateVarArgsThunk().  
Which crashes when it tries to CloneFunction the original virtual method, 
because an operand of some piece of metadata is still temporary.

So, either something happens such that EmitFunctionEnd() doesn't actually call 
finalizeSubprogram(), or finalizeSubprogram() doesn't finalize everything that 
it needs to finalize.

finalizeSubprogram() retrieves the variables from the subprogram and handles 
them; what is it missing?


https://reviews.llvm.org/D37038



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to