[PATCH] D48024: [DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 05:48:18 PDT 2018


bjope added inline comments.


================
Comment at: include/llvm/IR/IntrinsicInst.h:98
+    /// that is described.
+    Optional<uint64_t> getFragmentSize() const;
+
----------------
aprantl wrote:
> `getFragmentSizeInBits()` ?
> 
> I'm still curious whether it makes sense to support the case where this returns None, or if we could add a Verifier check that is effectively `assert_di(getFragmentSize())`. Doesn't need to be in this commit though.
I don't know if we can do that check in the verifier. I guess it is bad if we can't determine the size of the variable (as we would lose debug info).

All I know is that there is a comment about "broken types" in the implementation of DIVariable::getSizeInBits():
```
Optional<uint64_t> DIVariable::getSizeInBits() const {
  // This is used by the Verifier so be mindful of broken types.
  ...
```
I have no idea if those "broken types" only exist in handwritten / poorly stripped IR, or if they are common in real use cases.


Repository:
  rL LLVM

https://reviews.llvm.org/D48024





More information about the llvm-commits mailing list