[PATCH] D107469: [LLVM][IR][NFC] Simplify writeDIGenericSubrange
Alf via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 5 13:38:31 PDT 2021
gAlfonso-bit updated this revision to Diff 364601.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107469/new/
https://reviews.llvm.org/D107469
Files:
llvm/include/llvm/IR/Metadata.h
llvm/lib/IR/AsmWriter.cpp
Index: llvm/lib/IR/AsmWriter.cpp
===================================================================
--- llvm/lib/IR/AsmWriter.cpp
+++ llvm/lib/IR/AsmWriter.cpp
@@ -1931,10 +1931,9 @@
auto IsConstant = [&](Metadata *Bound) -> bool {
if (auto *BE = dyn_cast_or_null<DIExpression>(Bound)) {
- return BE->isConstant()
- ? DIExpression::SignedOrUnsignedConstant::SignedConstant ==
- *BE->isConstant()
- : false;
+ return BE->isConstant() &&
+ DIExpression::SignedOrUnsignedConstant::SignedConstant ==
+ *BE->isConstant();
}
return false;
};
Index: llvm/include/llvm/IR/Metadata.h
===================================================================
--- llvm/include/llvm/IR/Metadata.h
+++ llvm/include/llvm/IR/Metadata.h
@@ -1312,9 +1312,9 @@
bool empty() const { return N ? N->getNumOperands() == 0 : true; }
T *operator[](unsigned I) const { return cast_or_null<T>(N->getOperand(I)); }
- // FIXME: Fix callers and remove condition on N.
using iterator = TypedMDOperandIterator<T>;
+ // FIXME: Fix callers and remove condition on N.
iterator begin() const { return N ? iterator(N->op_begin()) : iterator(); }
iterator end() const { return N ? iterator(N->op_end()) : iterator(); }
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107469.364601.patch
Type: text/x-patch
Size: 1317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210805/cd7c8159/attachment.bin>
More information about the llvm-commits
mailing list