[PATCH] D36943: Migrate WholeProgramDevirt to new Optimization Remark API
    Adam Nemet via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sun Aug 20 19:22:10 PDT 2017
    
    
  
anemet added inline comments.
================
Comment at: lib/Transforms/IPO/WholeProgramDevirt.cpp:523-526
+    auto OREGetter = [&](Function &F) -> OptimizationRemarkEmitter & {
+      OwnedORE = make_unique<OptimizationRemarkEmitter>(&F);
+      return *OwnedORE.get();
+    };
----------------
OwnedORE is freed here after the function returns and you're returning a pointer off of it.
I am not sure if we have any better options than just passing nullptr for OREGetter from the old PM path and build ORE at the use site if OREGetter is not set.
https://reviews.llvm.org/D36943
    
    
More information about the llvm-commits
mailing list