[llvm] r353904 - [dsymutil] Improve readability of cloneAllCompileUnits (NFC)
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 12 16:32:22 PST 2019
Author: jdevlieghere
Date: Tue Feb 12 16:32:21 2019
New Revision: 353904
URL: http://llvm.org/viewvc/llvm-project?rev=353904&view=rev
Log:
[dsymutil] Improve readability of cloneAllCompileUnits (NFC)
Add some newlines and improve consistency between the two loops.
Modified:
llvm/trunk/tools/dsymutil/DwarfLinker.cpp
Modified: llvm/trunk/tools/dsymutil/DwarfLinker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/DwarfLinker.cpp?rev=353904&r1=353903&r2=353904&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/DwarfLinker.cpp (original)
+++ llvm/trunk/tools/dsymutil/DwarfLinker.cpp Tue Feb 12 16:32:21 2019
@@ -2242,7 +2242,9 @@ void DwarfLinker::DIECloner::cloneAllCom
cloneDIE(InputDIE, DMO, *CurrentUnit, StringPool, 0 /* PC offset */,
11 /* Unit Header size */, 0, CurrentUnit->getOutputUnitDIE());
}
+
Linker.OutputDebugInfoSize = CurrentUnit->computeNextUnitOffset();
+
if (Linker.Options.NoOutput)
continue;
@@ -2251,9 +2253,12 @@ void DwarfLinker::DIECloner::cloneAllCom
// actually exist in the DIE tree.
if (LLVM_LIKELY(!Linker.Options.Update) || Linker.Options.Translator)
Linker.patchLineTableForUnit(*CurrentUnit, DwarfContext, Ranges, DMO);
+
Linker.emitAcceleratorEntriesForUnit(*CurrentUnit);
- if (Linker.Options.Update)
+
+ if (LLVM_UNLIKELY(Linker.Options.Update))
continue;
+
Linker.patchRangesForUnit(*CurrentUnit, DwarfContext, DMO);
Linker.Streamer->emitLocationsForUnit(*CurrentUnit, DwarfContext);
}
@@ -2265,11 +2270,14 @@ void DwarfLinker::DIECloner::cloneAllCom
for (auto &CurrentUnit : CompileUnits) {
if (LLVM_LIKELY(!Linker.Options.Update))
Linker.generateUnitRanges(*CurrentUnit);
+
CurrentUnit->fixupForwardReferences();
- if (CurrentUnit->getOutputUnitDIE()) {
- Linker.Streamer->emitCompileUnitHeader(*CurrentUnit);
- Linker.Streamer->emitDIE(*CurrentUnit->getOutputUnitDIE());
- }
+
+ if (!CurrentUnit->getOutputUnitDIE())
+ continue;
+
+ Linker.Streamer->emitCompileUnitHeader(*CurrentUnit);
+ Linker.Streamer->emitDIE(*CurrentUnit->getOutputUnitDIE());
}
}
More information about the llvm-commits
mailing list