[llvm] r269805 - llvm-dwp: Simplify duplicate DWO ID error handling
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Tue May 17 12:40:29 PDT 2016
Author: dblaikie
Date: Tue May 17 14:40:28 2016
New Revision: 269805
URL: http://llvm.org/viewvc/llvm-project?rev=269805&view=rev
Log:
llvm-dwp: Simplify duplicate DWO ID error handling
Modified:
llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
Modified: llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp?rev=269805&r1=269804&r2=269805&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp (original)
+++ llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp Tue May 17 14:40:28 2016
@@ -372,13 +372,13 @@ std::string buildDWODescription(StringRe
return Text;
}
-std::string
-buildDuplicateError(const std::pair<uint64_t, UnitIndexEntry> &PrevE,
- const CompileUnitIdentifiers &ID, StringRef DWPName) {
- return std::string("Duplicate DWO ID (") + utohexstr(PrevE.first) + ") in " +
- buildDWODescription(PrevE.second.Name, PrevE.second.DWPName,
- PrevE.second.DWOName) +
- " and " + buildDWODescription(ID.Name, DWPName, ID.DWOName);
+Error buildDuplicateError(const std::pair<uint64_t, UnitIndexEntry> &PrevE,
+ const CompileUnitIdentifiers &ID, StringRef DWPName) {
+ return make_error<DWPError>(
+ std::string("Duplicate DWO ID (") + utohexstr(PrevE.first) + ") in " +
+ buildDWODescription(PrevE.second.Name, PrevE.second.DWPName,
+ PrevE.second.DWOName) +
+ " and " + buildDWODescription(ID.Name, DWPName, ID.DWOName));
}
static Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
const auto &MCOFI = *Out.getContext().getObjectFileInfo();
@@ -523,7 +523,7 @@ static Error write(MCStreamer &Out, Arra
return EID.takeError();
const auto &ID = *EID;
if (!P.second)
- return make_error<DWPError>(buildDuplicateError(*P.first, ID, Input));
+ return buildDuplicateError(*P.first, ID, Input);
auto &NewEntry = P.first->second;
NewEntry.Name = ID.Name;
NewEntry.DWOName = ID.DWOName;
@@ -555,7 +555,7 @@ static Error write(MCStreamer &Out, Arra
const auto &ID = *EID;
auto P = IndexEntries.insert(std::make_pair(ID.Signature, CurEntry));
if (!P.second)
- return make_error<DWPError>(buildDuplicateError(*P.first, ID, ""));
+ return buildDuplicateError(*P.first, ID, "");
P.first->second.Name = ID.Name;
P.first->second.DWOName = ID.DWOName;
addAllTypes(Out, TypeIndexEntries, TypesSection, CurTypesSection,
More information about the llvm-commits
mailing list