[PATCH] D50495: [DebugInfo] Do not generate duplicated label debug info if it has been processed.

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 12 22:51:44 PDT 2018


HsiangKai added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1051
 void CodeViewDebug::collectVariableInfoFromMFTable(
-    DenseSet<InlinedVariable> &Processed) {
+    DenseSet<InlinedEntity> &Processed) {
   const MachineFunction &MF = *Asm->MF;
----------------
aprantl wrote:
> If this processes only variables, why return a set of InlinedEntities instead of InlinedVariables?
DILocalVariable and DILabel are both DINode. So, I combined InlinedVariable and InlinedLabel into InlinedEntity.
In this way, I have no need to allocate two separate ‘Processed’ sets for them. It is cleaner to check them processed or not.

So, there is no InlinedVariable any more in this patch.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1505
+        Scope = DV->getScope();
+      else if (auto *DL = dyn_cast<DILabel>(DN))
+        Scope = DL->getScope();
----------------
aprantl wrote:
> this is equivalent to 
> ```
> else {
>   auto *DL = cast<DILabel>(DN); // llvm::cast asserts automatically.
>   Scope = DL->getScope();
> }
I keep the symmetric form of these if condition. It is cleaner to express the intension that there are two kinds of debug entity to process. If there is another debug entity to process in the future, it could add another if condition for it.


Repository:
  rL LLVM

https://reviews.llvm.org/D50495





More information about the llvm-commits mailing list