[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca
Paul Robinson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 23 16:40:16 PDT 2017
probinson added a comment.
Anytime the code between saveIP() and restoreIP() could set the current debug location, it needs to be saved/restored along with the insertion point. I have to say the problem is not obvious to me here, so maybe saveIP/restoreIP should be changed (or eliminated in favor of always using InsertPointGuard). I'm not seeing a lot of places where saveIP/restoreIP are used.
The test looks like all it's doing is verifying both calls have a debug location at all. It could verify that both calls have the _same_ debug location, which I would find much more robust and convincing.
More information about the cfe-commits