summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-dwp/llvm-dwp.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2016-05-17 19:40:28 +0000
committerDavid Blaikie <dblaikie@gmail.com>2016-05-17 19:40:28 +0000
commit11825c72371feb23ef9322320af1269012d24b74 (patch)
tree0d126787cd1ff337d37415833719894ecb034df3 /llvm/tools/llvm-dwp/llvm-dwp.cpp
parente15ef2f6093430bb3a7965f05c18795501a65129 (diff)
downloadbcm5719-llvm-11825c72371feb23ef9322320af1269012d24b74.tar.gz
bcm5719-llvm-11825c72371feb23ef9322320af1269012d24b74.zip
llvm-dwp: Simplify duplicate DWO ID error handling
llvm-svn: 269805
Diffstat (limited to 'llvm/tools/llvm-dwp/llvm-dwp.cpp')
-rw-r--r--llvm/tools/llvm-dwp/llvm-dwp.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
index a05736ebe21..60d07207ed4 100644
--- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
+++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
@@ -372,13 +372,13 @@ std::string buildDWODescription(StringRef Name, StringRef DWPName, StringRef DWO
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, ArrayRef<std::string> Inputs) {
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, ArrayRef<std::string> Inputs) {
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,
OpenPOWER on IntegriCloud