[PATCH] Ensure debug info for two calls to the same function from the same location are not merged
Eric Christopher
echristo at gmail.com
Wed Dec 3 15:09:41 PST 2014
A few comments inline, but this type of problem is why we have discriminators as well - to be able to distinguish between two things that happen at the same location - this isn't the case for that, those are designed around things that happen at the same file/line/column but are in different basic blocks.
But essentially you're adding a unique discriminator to each inlined call which works for me to solve the problem.
================
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,
----------------
dblaikie wrote:
> Honestly I find this recursive loop function a bit hard to follow & wonder about refactoring it into a loop.
I think naming changes might make it easier, but I have no problem with you removing the recursion either.
================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:866
@@ -850,1 +865,3 @@
+ auto &Ctx = Fn->getContext();
+ auto *InlinedAtNode = TheCallDL.getAsMDNode(Ctx);
----------------
Needs some comments here, it's a bit hard to follow the new logic. Maybe document the entire function algorithm now.
http://reviews.llvm.org/D6390
More information about the llvm-commits
mailing list