mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 07:39:31 +00:00
llvm-dwp: Reduce indentation
llvm-svn: 270507
This commit is contained in:
parent
615566d9bf
commit
2f24ecd6f1
@ -521,7 +521,25 @@ static Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
||||
if (InfoSection.empty())
|
||||
continue;
|
||||
|
||||
if (!CurCUIndexSection.empty()) {
|
||||
writeStringsAndOffsets(Out, Strings, StrOffsetSection, CurStrSection,
|
||||
CurStrOffsetSection);
|
||||
|
||||
if (CurCUIndexSection.empty()) {
|
||||
Expected<CompileUnitIdentifiers> EID = getCUIdentifiers(
|
||||
AbbrevSection, InfoSection, CurStrOffsetSection, CurStrSection);
|
||||
if (!EID)
|
||||
return EID.takeError();
|
||||
const auto &ID = *EID;
|
||||
auto P = IndexEntries.insert(std::make_pair(ID.Signature, CurEntry));
|
||||
if (!P.second)
|
||||
return buildDuplicateError(*P.first, ID, "");
|
||||
P.first->second.Name = ID.Name;
|
||||
P.first->second.DWOName = ID.DWOName;
|
||||
addAllTypes(Out, TypeIndexEntries, TypesSection, CurTypesSection,
|
||||
CurEntry, ContributionOffsets[DW_SECT_TYPES - DW_SECT_INFO]);
|
||||
continue;
|
||||
}
|
||||
|
||||
DWARFUnitIndex CUIndex(DW_SECT_INFO);
|
||||
DataExtractor CUIndexData(CurCUIndexSection, Obj.isLittleEndian(), 0);
|
||||
if (!CUIndex.parse(CUIndexData))
|
||||
@ -531,8 +549,7 @@ static Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
||||
auto *I = E.getOffsets();
|
||||
if (!I)
|
||||
continue;
|
||||
auto P =
|
||||
IndexEntries.insert(std::make_pair(E.getSignature(), CurEntry));
|
||||
auto P = IndexEntries.insert(std::make_pair(E.getSignature(), CurEntry));
|
||||
Expected<CompileUnitIdentifiers> EID = getCUIdentifiers(
|
||||
getSubsection(AbbrevSection, E, DW_SECT_ABBREV),
|
||||
getSubsection(InfoSection, E, DW_SECT_INFO),
|
||||
@ -557,8 +574,7 @@ static Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
||||
|
||||
if (!CurTypesSection.empty()) {
|
||||
if (CurTypesSection.size() != 1)
|
||||
return make_error<DWPError>(
|
||||
"multiple type unit sections in .dwp file");
|
||||
return make_error<DWPError>("multiple type unit sections in .dwp file");
|
||||
DWARFUnitIndex TUIndex(DW_SECT_TYPES);
|
||||
DataExtractor TUIndexData(CurTUIndexSection, Obj.isLittleEndian(), 0);
|
||||
if (!TUIndex.parse(TUIndexData))
|
||||
@ -567,23 +583,6 @@ static Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
||||
CurTypesSection.front(), CurEntry,
|
||||
ContributionOffsets[DW_SECT_TYPES - DW_SECT_INFO]);
|
||||
}
|
||||
} else {
|
||||
Expected<CompileUnitIdentifiers> EID = getCUIdentifiers(
|
||||
AbbrevSection, InfoSection, CurStrOffsetSection, CurStrSection);
|
||||
if (!EID)
|
||||
return EID.takeError();
|
||||
const auto &ID = *EID;
|
||||
auto P = IndexEntries.insert(std::make_pair(ID.Signature, CurEntry));
|
||||
if (!P.second)
|
||||
return buildDuplicateError(*P.first, ID, "");
|
||||
P.first->second.Name = ID.Name;
|
||||
P.first->second.DWOName = ID.DWOName;
|
||||
addAllTypes(Out, TypeIndexEntries, TypesSection, CurTypesSection,
|
||||
CurEntry, ContributionOffsets[DW_SECT_TYPES - DW_SECT_INFO]);
|
||||
}
|
||||
|
||||
writeStringsAndOffsets(Out, Strings, StrOffsetSection, CurStrSection,
|
||||
CurStrOffsetSection);
|
||||
}
|
||||
|
||||
// Lie about there being no info contributions so the TU index only includes
|
||||
|
Loading…
Reference in New Issue
Block a user