================
@@ -538,55 +546,71 @@ class MetadataLoader::MetadataLoaderImpl {
 
   /// Move local imports from DICompileUnit's 'imports' field to
   /// DISubprogram's retainedNodes.
+  /// Move function-local enums from DICompileUnit's enums
+  /// to DISubprogram's retainedNodes.
   void upgradeCULocals() {
     if (NamedMDNode *CUNodes = TheModule.getNamedMetadata("llvm.dbg.cu")) {
       for (MDNode *N : CUNodes->operands()) {
         auto *CU = dyn_cast<DICompileUnit>(N);
         if (!CU)
           continue;
 
-        if (CU->getRawImportedEntities()) {
-          // Collect a set of imported entities to be moved.
-          SetVector<Metadata *> EntitiesToRemove;
+        SetVector<Metadata *> MetadataToRemove;
+        // Collect imported entities to be moved.
+        if (CU->getRawImportedEntities())
----------------
jmorse wrote:

Could you give an overview of the algorithm being used in this function, as I 
can't piece it together: we've got the collection of metadata-to-remove _from_ 
the CU, and the `NewImports` `NewEnums` collections are the remainder of 
`retainedNodes` elements that won't be moved to `DISubprogram`s? If so, I think 
the term "New" is giving me slight confusion, could we use the term "remaining" 
or "KeepInCU" or something like that?

https://github.com/llvm/llvm-project/pull/165032
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to