[PATCH] D69839: [DebugInfo] Fix for stopping emission of debug_macinfo section in normal case and -fno-debug-macro switch enabled case.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 11:52:31 PST 2019


dblaikie added a comment.

In D69839#1734537 <https://reviews.llvm.org/D69839#1734537>, @SouraVX wrote:

> Hi, Sorry, I just missed out the key part. This patch fixes / stop emission of ...
>  When "-fno-debug-macro' switch is enabled, which is by default. 
>  So all CUNode->getMacro() should be empty in first place, since no debug information of macro is cooked by clang ?? Right?


Yes, when -fno-debug-macro is passed, CUNode->getMacros() would return an empty list. (both your proposed change and my proposed change rely on this property - yours checks emptiness separately/ahead of the main loop, mine relies on it already being checked in the loop)

> So for this case @dblaikie your concerns seems reasonable, but this patch, doesn't touches those things. I may be wrong here ??

I'm suggesting that fixing the end of list marker bug, so that the bug you're trying to fix can be fixed in a less verbose/tidier way, would be the path I would prefer - rather than adding more code, we can fix this by (fixing a bug and) removing code, which is a better path forward because generally less code is easier to understand, less likely to have other bugs, easier to maintain, etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69839





More information about the llvm-commits mailing list