summaryrefslogtreecommitdiffstats
path: root/llvm/lib/XRay/InstrumentationMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/XRay/InstrumentationMap.cpp')
-rw-r--r--llvm/lib/XRay/InstrumentationMap.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/XRay/InstrumentationMap.cpp b/llvm/lib/XRay/InstrumentationMap.cpp
index 7de953d46b7..7453613c703 100644
--- a/llvm/lib/XRay/InstrumentationMap.cpp
+++ b/llvm/lib/XRay/InstrumentationMap.cpp
@@ -67,10 +67,11 @@ loadObj(StringRef Filename, object::OwningBinary<object::ObjectFile> &ObjFile,
StringRef Contents = "";
const auto &Sections = ObjFile.getBinary()->sections();
auto I = llvm::find_if(Sections, [&](object::SectionRef Section) {
- StringRef Name = "";
- if (Section.getName(Name))
- return false;
- return Name == "xray_instr_map";
+ Expected<StringRef> NameOrErr = Section.getName();
+ if (NameOrErr)
+ return *NameOrErr == "xray_instr_map";
+ consumeError(NameOrErr.takeError());
+ return false;
});
if (I == Sections.end())
OpenPOWER on IntegriCloud