Go to file
Teresa Johnson 3513dc245e [ThinLTO] Fix a crash in lazy loading of Metadata
Summary:
This is a revised version of D41474.

When the debug location is parsed in BitcodeReader::parseFunction, the
scope and inlinedAt MDNodes are obtained via MDLoader->getMDNodeFwdRefOrNull(),
which will create a forward ref if they were not yet loaded.
Specifically, if one of these MDNodes is in the module level metadata
block, and this is during ThinLTO importing, that metadata block is
lazily loaded.

Most places in that invoke getMDNodeFwdRefOrNull have a corresponding call
to resolveForwardRefsAndPlaceholders which will take care of resolving them.
E.g. places that call getMetadataFwdRefOrLoad, or at the end of parsing a
function-level metadata block, or at the end of the initial lazy load of
module level metadata in order to handle invocations of getMDNodeFwdRefOrNull
for named metadata and global object attachments. However, the calls for
the scope/inlinedAt of debug locations are not backed by any such call to
resolveForwardRefsAndPlaceholders.

To fix this, change the scope and inlinedAt parsing to instead use
getMetadataFwdRefOrLoad, which will ensure the forward refs to lazily
loaded metadata are resolved.

Fixes PR35472.

Reviewers: dexonsmith, Sunil_Srivastava, vsk

Subscribers: inglorion, eraman, steven_wu, sebpop, mehdi_amini, dmikulin, vsk, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D53596

llvm-svn: 345095
2018-10-23 22:57:21 +00:00
clang NFC: Remove MANGLE_CHECKER from ItaniumMangle.cpp 2018-10-23 19:55:38 +00:00
clang-tools-extra [clang-tidy] Add a separate section for NOLINT(NEXTLINE)? doc. 2018-10-23 16:48:16 +00:00
compiler-rt [hwasan] add stack frame descriptions. 2018-10-23 00:50:40 +00:00
debuginfo-tests Revert "(Retry) Add a basic integration test for C++ smart pointers" 2018-08-20 19:53:33 +00:00
libclc configure: Rework support for gfx9+ devices that were added post LLVM 3.9 2018-09-15 22:02:01 +00:00
libcxx Off-by-one errors strike again. Thank goodness for ASAN and the bots. 2018-10-23 20:07:45 +00:00
libcxxabi cxa_demangle: make demangler's parsing functions overridable 2018-10-16 14:29:14 +00:00
libunwind [CMake] Link to compiler-rt if LIBUNWIND_USE_COMPILER_RT is ON. 2018-10-08 18:35:00 +00:00
lld Move forward declarations to the top of the file and sort. 2018-10-23 22:37:14 +00:00
lldb Remove unused private methods. 2018-10-23 22:15:27 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm [ThinLTO] Fix a crash in lazy loading of Metadata 2018-10-23 22:57:21 +00:00
openmp [OpenMP] Convert KMP_DYNAMIC_LIB to a 0 or 1 guard everywhere 2018-10-05 17:59:39 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly [TI removal] Generically discuss terminators rather than use the soon to 2018-10-18 07:43:30 +00:00
README.md Update the project name in README.md 2018-10-19 00:03:01 +00:00

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.