diff options
| author | Adrian Prantl <aprantl@apple.com> | 2020-03-04 14:12:54 -0800 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2020-03-11 14:14:06 -0700 |
| commit | e4e7e44765c27c788a2a679004f1f65e1fca8005 (patch) | |
| tree | 36507304a9d5381394d3483c2140d9482a03005e /llvm/lib/Bitcode/Reader/MetadataLoader.cpp | |
| parent | e08464fb450456881733c885267b32dc7339cf11 (diff) | |
Add an SDK attribute to DICompileUnit
This is part of PR44213 https://bugs.llvm.org/show_bug.cgi?id=44213
When importing (system) Clang modules, LLDB needs to know which SDK
(e.g., MacOSX, iPhoneSimulator, ...) they came from. While the sysroot
attribute contains the absolute path to the SDK, this doesn't work
well when the debugger is run on a different machine than the
compiler, and the SDKs are installed in different directories. It thus
makes sense to just store the name of the SDK instead of the absolute
path, so it can be found relative to LLDB.
rdar://problem/51645582
Differential Revision: https://reviews.llvm.org/D75646
Diffstat (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp')
| -rw-r--r-- | llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp index 9a78a2bbcb4f..17778e73f2f0 100644 --- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp @@ -1456,7 +1456,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( break; } case bitc::METADATA_COMPILE_UNIT: { - if (Record.size() < 14 || Record.size() > 21) + if (Record.size() < 14 || Record.size() > 22) return error("Invalid record"); // Ignore Record[0], which indicates whether this compile unit is @@ -1474,7 +1474,8 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( Record.size() <= 18 ? 0 : Record[18], false, // FIXME: https://reviews.llvm.org/rGc51b45e32ef7f35c11891f60871aa9c2c04cd991 // Record.size() <= 19 ? 0 : Record[19], - Record.size() <= 20 ? nullptr : getMDString(Record[20])); + Record.size() <= 20 ? nullptr : getMDString(Record[20]), + Record.size() <= 21 ? nullptr : getMDString(Record[21])); MetadataList.assignValue(CU, NextMetadataNo); NextMetadataNo++; |
