[PATCH] Ensure debug info for two calls to the same function from the same location are not merged

David Blaikie dblaikie at gmail.com
Mon Nov 24 12:33:46 PST 2014


================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:829
@@ -828,4 +828,3 @@
 /// recursively update InlinedAtEntry of a DebugLoc.
-static DebugLoc updateInlinedAtInfo(const DebugLoc &DL, 
-                                    const DebugLoc &InlinedAtDL,
-                                    LLVMContext &Ctx) {
+static DebugLoc updateInlinedAtInfo(const DebugLoc &DL, MDNode *InlinedAtNode,
+                                    LLVMContext &Ctx,
----------------
Honestly I find this recursive loop function a bit hard to follow & wonder about refactoring it into a loop.

================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:838
@@ +837,3 @@
+
+      InlinedAtNode = NewInlinedAtDL.getAsMDNode(Ctx);
+      MDNode *TempNode = MDNode::getTemporary(Ctx, None);
----------------
This code duplication I'm introducing here should be refactored away before the change is submitted, but I haven't decided how - open to ideas. (the obvious one is just to write a small utility function, but I'm wondering if it can be more refactored-by-design)

http://reviews.llvm.org/D6390






More information about the llvm-commits mailing list