tbaeder marked 4 inline comments as done. tbaeder added inline comments.
================ Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1127 return false; - if (!this->emitInitGlobal(*T, *I, VD)) + } + } else { ---------------- aaron.ballman wrote: > tbaeder wrote: > > aaron.ballman wrote: > > > and if we have no `GlobalIndex`? > > > > > > Should this instead be: > > > ``` > > > if (auto GlobalIndex = P.getGlobal(VD); !GlobalIndex || > > > !this->emitGetPtrGlobal(*GlobalIndex, VD)) > > > return false; > > > ``` > > > > > I mean, that shouldn't happen because the `visitVarDecl` call before > > would've returned `false` in that case. > The use of an `if` makes it seem like it could fail. Perhaps we should drop > the `if` and use an `assert`? What do you think about returning a `tuple(valid, offset)` from `visitVarDecl`? Although that might make the call in `ByteCodeStmtGen.cpp` a little awkward. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136815/new/ https://reviews.llvm.org/D136815 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits