[PATCH] D41474: Fix a crash in lazy loading of Metadata in ThinLTO

Sunil Srivastava via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 21 09:38:52 PST 2017

Sunil_Srivastava added a comment.

> What created the forward ref? Do you know why it wasn't resolved in the usual way?

What is the usual way of resolving forward refs?

I modeled FinishFunctionMetadata code from ..MetadataLoaderImpl::parseMetadats just below it, which calls lazyLoadModuleMetadataBlcok and then resolveForwardRefsandPlaceholders just after that. So I assumed that will be the usual way.

The unique thing in this test case is that a normal function, with debug info, gets inlined inside a nodebug function. The inlined instructions have attached metadata whereas the whole function is still nodebug.

The semantics of this situation is not clearly defined. We could rule that the debug info from inlined code should be stripped., which will avoid this problem in the first case, but I can see that some users may carefully choose where they want debug info and the inlining will foil their attempt then.


More information about the llvm-commits mailing list