[PATCH] D67998: [llvm-readobj/llvm-readelf]: Dump stack-size entry for all function symbols that have a particular value (fixes PR43245)
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 01:47:31 PDT 2019
grimar added inline comments.
================
Comment at: tools/llvm-readobj/ELFDumper.cpp:4732
+ printStackSizeEntry(StackSize, "?");
+ }
+
----------------
I'd add a early return here:
```
if (FuncSyms.empty()) {
reportWarning(
createError("could not identify function symbol for stack size entry"),
Obj->getFileName());
printStackSizeEntry(StackSize, "?");
return;
}
```
================
Comment at: tools/llvm-readobj/ELFDumper.cpp:4749
+ printStackSizeEntry(StackSize, FuncName);
+ }
}
----------------
Perhaps inline `FuncName`? It would remove one string assignment for the normal case:
```
for (const SymbolRef &FuncSym : FuncSyms) {
// A valid SymbolRef has a non-null object file pointer.
if (FuncSym.BasicSymbolRef::getObject()) {
// Extract the symbol name.
Expected<StringRef> FuncNameOrErr = FuncSym.getName();
if (FuncNameOrErr)
printStackSizeEntry(StackSize, maybeDemangle(*FuncNameOrErr));
else
consumeError(FuncNameOrErr.takeError());
continue;
}
reportWarning(
createError("could not identify function symbol for stack size entry"),
Obj->getFileName());
printStackSizeEntry(StackSize, "?");
}
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67998/new/
https://reviews.llvm.org/D67998
More information about the llvm-commits
mailing list