[PATCH] D48676: [Local] replaceAllDbgUsesWith: Update debug values before RAUW

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 5 11:00:48 PDT 2018


aprantl added inline comments.


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:2332
+    void appendToVector(SmallVectorImpl<uint64_t> &V) const {
+      V.append(getSize(), *get());
+    }
----------------
vsk wrote:
> aprantl wrote:
> > This looks very dangerous. DIExpressions are not distinct so they may be shared by many users. Shouldn't we create a new DIExpression instead of modifying the old one?
> Why does this modify an existing expression? I think I'm only using it to create a new expression (in DIExpression::appendToStack, `appendToVector(NewOps)`).
My bad. I overlooked that this is a const member and that V is the one being modified. Sorry for the noise!


https://reviews.llvm.org/D48676





More information about the llvm-commits mailing list