aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/llvm-project/llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp b/contrib/llvm-project/llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp
index ad35aefe7774..a60b2d386076 100644
--- a/contrib/llvm-project/llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp
+++ b/contrib/llvm-project/llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp
@@ -68,7 +68,7 @@ static std::vector<uint8_t> getUUID(const object::ObjectFile &Obj) {
}
llvm::Error ObjectFileTransformer::convert(const object::ObjectFile &Obj,
- raw_ostream &Log,
+ raw_ostream *Log,
GsymCreator &Gsym) {
using namespace llvm::object;
@@ -92,15 +92,18 @@ llvm::Error ObjectFileTransformer::convert(const object::ObjectFile &Obj,
return AddrOrErr.takeError();
if (SymType.get() != SymbolRef::Type::ST_Function ||
- !Gsym.IsValidTextAddress(*AddrOrErr) ||
- Gsym.hasFunctionInfoForAddress(*AddrOrErr))
+ !Gsym.IsValidTextAddress(*AddrOrErr))
continue;
// Function size for MachO files will be 0
constexpr bool NoCopy = false;
const uint64_t size = IsELF ? ELFSymbolRef(Sym).getSize() : 0;
Expected<StringRef> Name = Sym.getName();
if (!Name) {
- logAllUnhandledErrors(Name.takeError(), Log, "ObjectFileTransformer: ");
+ if (Log)
+ logAllUnhandledErrors(Name.takeError(), *Log,
+ "ObjectFileTransformer: ");
+ else
+ consumeError(Name.takeError());
continue;
}
// Remove the leading '_' character in any symbol names if there is one
@@ -111,6 +114,8 @@ llvm::Error ObjectFileTransformer::convert(const object::ObjectFile &Obj,
FunctionInfo(*AddrOrErr, size, Gsym.insertString(*Name, NoCopy)));
}
size_t FunctionsAddedCount = Gsym.getNumFunctionInfos() - NumBefore;
- Log << "Loaded " << FunctionsAddedCount << " functions from symbol table.\n";
+ if (Log)
+ *Log << "Loaded " << FunctionsAddedCount
+ << " functions from symbol table.\n";
return Error::success();
}