summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/ObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ObjectFile.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
index 081e29c21b6..cc0b282665d 100644
--- a/llvm/lib/Object/ObjectFile.cpp
+++ b/llvm/lib/Object/ObjectFile.cpp
@@ -68,9 +68,8 @@ std::error_code ObjectFile::printSymbolName(raw_ostream &OS,
uint32_t ObjectFile::getSymbolAlignment(DataRefImpl DRI) const { return 0; }
bool ObjectFile::isSectionBitcode(DataRefImpl Sec) const {
- StringRef SectName;
- if (!getSectionName(Sec, SectName))
- return SectName == ".llvmbc";
+ if (Expected<StringRef> NameOrErr = getSectionName(Sec))
+ return *NameOrErr == ".llvmbc";
return false;
}
OpenPOWER on IntegriCloud