[PATCH] D37038: Replace temp MD nodes with unique/distinct before cloning

Paul Robinson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 25 16:59:43 PDT 2017


probinson added inline comments.


================
Comment at: lib/CodeGen/CGVTables.cpp:157
+  if (DebugInfo)
+    DebugInfo->replaceTemporaryNodes();
+
----------------
aprantl wrote:
> Have you looked at what it would take to only finalize the nodes reachable via the function?
> Otherwise — have you audited that this is always safe?
I do not know how to find nodes reachable from a particular function, either before or after they are finalized.

GenerateVarArgsThunk is called after we do EmitGlobalFunctionDefinition on the function we are about to clone.  The ReplaceMap holds replaceable forward type declarations, I think?  So I can imagine that codegen for a subsequent function might need to create a complete type, even one that is reachable from the function we are about to clone.

Of course I find the whole metadata memory management scheme pretty opaque, but this is my best guess about the situation.


https://reviews.llvm.org/D37038





More information about the cfe-commits mailing list