1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Avoid MSVC failure with default arguments in lambdas from r267270

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11700

llvm-svn: 267277
This commit is contained in:
Duncan P. N. Exon Smith 2016-04-23 04:52:47 +00:00
parent f5921278f9
commit 434859c97e

View File

@ -1998,17 +1998,21 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) {
PlaceholderQueue Placeholders;
bool IsDistinct;
auto getMD = [&](unsigned ID, bool AllowPlaceholders = true) -> Metadata * {
if (!IsDistinct || !AllowPlaceholders)
auto getMD = [&](unsigned ID) -> Metadata * {
if (!IsDistinct)
return MetadataList.getMetadataFwdRef(ID);
if (auto *MD = MetadataList.getMetadataIfResolved(ID))
return MD;
return &Placeholders.getPlaceholderOp(ID);
};
auto getMDOrNull = [&](unsigned ID,
bool AllowPlaceholders = true) -> Metadata * {
auto getMDOrNull = [&](unsigned ID) -> Metadata * {
if (ID)
return getMD(ID - 1, AllowPlaceholders);
return getMD(ID - 1);
return nullptr;
};
auto getMDOrNullWithoutPlaceholders = [&](unsigned ID) -> Metadata * {
if (ID)
return MetadataList.getMetadataFwdRef(ID - 1);
return nullptr;
};
auto getMDString = [&](unsigned ID) -> MDString *{
@ -2331,8 +2335,7 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) {
MetadataList.assignValue(CU, NextMetadataNo++);
// Move the Upgrade the list of subprograms.
if (Metadata *SPs =
getMDOrNull(Record[11], /* AllowPlaceholders = */ false))
if (Metadata *SPs = getMDOrNullWithoutPlaceholders(Record[11]))
CUSubprograms.push_back({CU, SPs});
break;
}