[PATCH] D89218: [DebugInfo] Support for DW_TAG_generic_subrange
Djordje Todorovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 23:49:02 PDT 2020
djtodoro added a comment.
Some nits included.
================
Comment at: llvm/include/llvm/IR/DebugInfoMetadata.h:385
+ Metadata *getRawCountNode() const { return getOperand(0).get(); }
+
+ Metadata *getRawLowerBound() const { return getOperand(1).get(); }
----------------
I think we can remove this newlines.
================
Comment at: llvm/include/llvm/IR/DebugInfoMetadata.h:395
+ BoundType getCount() const;
+
+ BoundType getLowerBound() const;
----------------
Here as well.
================
Comment at: llvm/lib/AsmParser/LLParser.cpp:4608
+
+ Metadata *Count = nullptr;
+ Metadata *LowerBound = nullptr;
----------------
Don't need to initialize this to nullptr since the `convToMetadata()` will do that for us?
Therefore, we can just do:
Metadata *Count = convToMetadata(count);
..
================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1420
+ addBoundTypeEntry(dwarf::DW_AT_lower_bound, GSR->getLowerBound());
+
+ addBoundTypeEntry(dwarf::DW_AT_count, GSR->getCount());
----------------
We don't need these extra newlines.
================
Comment at: llvm/lib/IR/LLVMContextImpl.h:386
+ unsigned getHashValue() const {
+ if (CountNode)
+ if (auto *MD = dyn_cast<ConstantAsMetadata>(CountNode))
----------------
I suggest:
auto *MD = dyn_cast<ConstantAsMetadata>(CountNode);
if (CountNode && MD)
return hash_combine(cast<ConstantInt>(...);
return hash_combine(CountNode,...);
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89218/new/
https://reviews.llvm.org/D89218
More information about the llvm-commits
mailing list