krisb added a comment.

@jmmartinez thank you for looking at this!



================
Comment at: llvm/lib/IR/DIBuilder.cpp:789
+  return createLocalVariable(
+      VMContext, getSubprogramNodesTrackingVector(Scope), Scope, Name,
+      /* ArgNo */ 0, File, LineNo, Ty, AlwaysPreserve, Flags, AlignInBits);
----------------
jmmartinez wrote:
> I'll be tempted to move the call to `getSubprogramNodesTrackingVector(Scope)` 
> into `createLocalVariable`. It seems that every time `createLocalVariable` is 
> called, `getSubprogramNodesTrackingVector(Scope)` is passed as value for 
> `PreservedNodes`.
> 
> (I've just started reviewing so I may be missing some other modifications)
That's right, but the problem is in the fact that `createLocalVariable()` is 
static while `getSubprogramNodesTrackingVector()` is a DIBuilder's member. To 
move the call inside `createLocalVariable()` we need either to make it a member 
of DIBuilder or to pass DIBuilder object to it. None of these options looks 
much better to me, honestly. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143984

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D143... Juan Manuel Martinez Caamaño via Phabricator via cfe-commits
    • [PATCH]... Kristina Bessonova via Phabricator via cfe-commits
    • [PATCH]... Juan Manuel Martinez Caamaño via Phabricator via cfe-commits
    • [PATCH]... Kristina Bessonova via Phabricator via cfe-commits
    • [PATCH]... Adrian Prantl via Phabricator via cfe-commits
    • [PATCH]... Kristina Bessonova via Phabricator via cfe-commits
    • [PATCH]... Juan Manuel Martinez Caamaño via Phabricator via cfe-commits
    • [PATCH]... Kristina Bessonova via Phabricator via cfe-commits

Reply via email to