[PATCH] D138561: [Assignment Tracking] Fix DbgVariableIntrinsic::replaceVariableLocationOp

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 04:43:24 PST 2022


StephenTozer added a comment.

LGTM with minor comments.



================
Comment at: llvm/unittests/IR/DebugInfoTest.cpp:405-406
+  DbgAssignIntrinsic *DAI = cast<DbgAssignIntrinsic>(Fun.begin()->begin());
+  ASSERT_TRUE(V1 == DAI->getVariableLocationOp(0));
+
+#define TEST_REPLACE(Old, New, ExpectedValue, ExpectedAddr)                    \
----------------
YMMV, but while we're confirming one we may as well confirm the other?


================
Comment at: llvm/unittests/IR/DebugInfoTest.cpp:417
+  // Replace both.
+  TEST_REPLACE(/*Old*/ P2, /*New*/ P1, /*Value*/ P1, /*Address*/ P1);
+
----------------
Might be worth also adding a test that it correctly asserts when trying to replace a value that does not appear in the address or value?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138561/new/

https://reviews.llvm.org/D138561



More information about the llvm-commits mailing list