diff options
Diffstat (limited to 'llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp')
| -rw-r--r-- | llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp b/llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp index 6ed284a66a85..8c52040fdbc9 100644 --- a/llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp +++ b/llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp @@ -294,7 +294,7 @@ void CompileUnit::analyzeImportedModule(const DWARFDebugInfoEntry *DieEntry) { ": " + Entry + " and " + Path + ".", &Die); } - Entry = std::string(ResolvedPath.str()); + Entry = std::string(ResolvedPath); } } @@ -1229,8 +1229,9 @@ void CompileUnit::cloneDieAttrExpression( } } -Error CompileUnit::cloneAndEmit(std::optional<Triple> TargetTriple, - TypeUnit *ArtificialTypeUnit) { +Error CompileUnit::cloneAndEmit( + std::optional<std::reference_wrapper<const Triple>> TargetTriple, + TypeUnit *ArtificialTypeUnit) { BumpPtrAllocator Allocator; DWARFDie OrigUnitDIE = getOrigUnit().getUnitDIE(); @@ -1247,18 +1248,17 @@ Error CompileUnit::cloneAndEmit(std::optional<Triple> TargetTriple, std::nullopt, std::nullopt, Allocator, ArtificialTypeUnit); setOutUnitDIE(OutCUDie.first); - if (getGlobalData().getOptions().NoOutput || (OutCUDie.first == nullptr)) + if (!TargetTriple.has_value() || (OutCUDie.first == nullptr)) return Error::success(); - assert(TargetTriple.has_value()); - if (Error Err = cloneAndEmitLineTable(*TargetTriple)) + if (Error Err = cloneAndEmitLineTable((*TargetTriple).get())) return Err; if (Error Err = cloneAndEmitDebugMacro()) return Err; getOrCreateSectionDescriptor(DebugSectionKind::DebugInfo); - if (Error Err = emitDebugInfo(*TargetTriple)) + if (Error Err = emitDebugInfo((*TargetTriple).get())) return Err; // ASSUMPTION: .debug_info section should already be emitted at this point. @@ -1372,7 +1372,7 @@ DIE *CompileUnit::createPlainDIEandCloneAttributes( // Get relocation adjustment value for the current function. FuncAddressAdjustment = getContaingFile().Addresses->getSubprogramRelocAdjustment( - getDIE(InputDieEntry)); + getDIE(InputDieEntry), false); } else if (InputDieEntry->getTag() == dwarf::DW_TAG_label) { // Get relocation adjustment value for the current label. std::optional<uint64_t> lowPC = @@ -1386,7 +1386,7 @@ DIE *CompileUnit::createPlainDIEandCloneAttributes( // Get relocation adjustment value for the current variable. std::pair<bool, std::optional<int64_t>> LocExprAddrAndRelocAdjustment = getContaingFile().Addresses->getVariableRelocAdjustment( - getDIE(InputDieEntry)); + getDIE(InputDieEntry), false); HasLocationExpressionAddress = LocExprAddrAndRelocAdjustment.first; if (LocExprAddrAndRelocAdjustment.first && @@ -1514,7 +1514,7 @@ TypeEntry *CompileUnit::createTypeDIEandCloneAttributes( return Entry; } -Error CompileUnit::cloneAndEmitLineTable(Triple &TargetTriple) { +Error CompileUnit::cloneAndEmitLineTable(const Triple &TargetTriple) { const DWARFDebugLine::LineTable *InputLineTable = getContaingFile().Dwarf->getLineTableForUnit(&getOrigUnit()); if (InputLineTable == nullptr) { |
