[PATCH] D23715: Add @llvm.dbg.value entries for the phi node created by -mem2reg

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 16 15:57:04 PDT 2016


aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

Couple of small style nitpicks, but otherwise LGTM.

Thanks!


================
Comment at: lib/Transforms/Utils/Local.cpp:1143
@@ +1142,3 @@
+/// that has an associated llvm.dbg.decl intrinsic.
+bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
+                                           PHINode *APN, DIBuilder &Builder) {
----------------
Would be a good opportunity to also convert the other function to return void. The return value used to necessary when the function was originally added, but this is no longer the case.

================
Comment at: lib/Transforms/Utils/Local.cpp:1225
@@ -1189,1 +1224,3 @@
 
+/// FindAllocaDbgValues - Finds the llvm.dbg.value intrinsics describing the
+/// alloca 'V', if any.
----------------
The "FindAllocaDbgValues - " is no longer needed with our current doxygen settings.

================
Comment at: lib/Transforms/Utils/Local.cpp:1227
@@ +1226,3 @@
+/// alloca 'V', if any.
+void llvm::FindAllocaDbgValues(DbgValueList &DbgValues, Value *V) {
+  if (auto *L = LocalAsMetadata::getIfExists(V))
----------------
This is up to taste, but this could also be written as taking a function/lambda callback instead of creating a temporary array.


https://reviews.llvm.org/D23715





More information about the llvm-commits mailing list