diff options
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
| -rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index f17656c..845ecb4 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -956,6 +956,8 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) { return bitc::ATTR_KIND_CAPTURES; case Attribute::DeadOnReturn: return bitc::ATTR_KIND_DEAD_ON_RETURN; + case Attribute::NoCreateUndefOrPoison: + return bitc::ATTR_KIND_NO_CREATE_UNDEF_OR_POISON; case Attribute::EndAttrKinds: llvm_unreachable("Can not encode end-attribute kinds marker."); case Attribute::None: @@ -3028,11 +3030,12 @@ void ModuleBitcodeWriter::writeConstants(unsigned FirstVal, unsigned LastVal, Record.push_back(VE.getTypeID(NC->getGlobalValue()->getType())); Record.push_back(VE.getValueID(NC->getGlobalValue())); } else if (const auto *CPA = dyn_cast<ConstantPtrAuth>(C)) { - Code = bitc::CST_CODE_PTRAUTH; + Code = bitc::CST_CODE_PTRAUTH2; Record.push_back(VE.getValueID(CPA->getPointer())); Record.push_back(VE.getValueID(CPA->getKey())); Record.push_back(VE.getValueID(CPA->getDiscriminator())); Record.push_back(VE.getValueID(CPA->getAddrDiscriminator())); + Record.push_back(VE.getValueID(CPA->getDeactivationSymbol())); } else { #ifndef NDEBUG C->dump(); @@ -3842,6 +3845,9 @@ void ModuleBitcodeWriter::writeFunction( } else if (DVR.isDbgDeclare()) { Vals.push_back(VE.getMetadataID(DVR.getRawLocation())); Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_RECORD_DECLARE, Vals); + } else if (DVR.isDbgDeclareValue()) { + Vals.push_back(VE.getMetadataID(DVR.getRawLocation())); + Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_RECORD_DECLARE_VALUE, Vals); } else { assert(DVR.isDbgAssign() && "Unexpected DbgRecord kind"); Vals.push_back(VE.getMetadataID(DVR.getRawLocation())); @@ -5242,8 +5248,10 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() { NameVals.push_back(ModuleIdMap[AS->modulePath()]); NameVals.push_back( getEncodedGVSummaryFlags(AS->flags(), shouldImportValueAsDecl(AS))); - auto AliaseeValueId = SummaryToValueIdMap[&AS->getAliasee()]; - assert(AliaseeValueId); + // Set value id to 0 when an alias is imported but the aliasee summary is + // not contained in the index. + auto AliaseeValueId = + AS->hasAliasee() ? SummaryToValueIdMap[&AS->getAliasee()] : 0; NameVals.push_back(AliaseeValueId); // Emit the finished record. @@ -5251,8 +5259,9 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() { NameVals.clear(); MaybeEmitOriginalName(*AS); - if (auto *FS = dyn_cast<FunctionSummary>(&AS->getAliasee())) - getReferencedTypeIds(FS, ReferencedTypeIds); + if (AS->hasAliasee()) + if (auto *FS = dyn_cast<FunctionSummary>(&AS->getAliasee())) + getReferencedTypeIds(FS, ReferencedTypeIds); } SmallVector<StringRef, 4> Functions; |
