[PATCH] D87233: [POC][DebugInfo] Use entry values within IR
David Stenberg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 6 07:07:17 PDT 2020
dstenb added a comment.
Some minor code style comments while I look into this.
================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1600-1601
}
+EntryValue llvm::findEntryValue(Value *V, Function &F) {
+ if (F.empty())
----------------
Perhaps make the return type `Optional<EntryValue>`?
================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1634-1638
+ auto applyOffset = [&](uint64_t Offset) -> DIExpression * {
+ SmallVector<uint64_t, 8> Ops;
+ DIExpression::appendOffset(Ops, Offset);
+ DIExpr = DIExpression::prependOpcodes(DIExpr, Ops, true);
+ return DIExpr;
----------------
I think this should be able to be simplified into:
```
return DIExpression::prepend(DIExpr, DIExpression::StackValue, Offset);
```
(And perhaps the lambda is not necessary then.)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87233/new/
https://reviews.llvm.org/D87233
More information about the llvm-commits
mailing list