gandhi21299 added inline comments.

================
Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:175
 
+  ORE = std::make_unique<OptimizationRemarkEmitter>(&F);
   auto &TM = TPC->getTM<TargetMachine>();
----------------
rampitec wrote:
> gandhi21299 wrote:
> > rampitec wrote:
> > > Is there a reason to construct it upfront and not just use a local 
> > > variable only when needed? Like in StackProtector.cpp for example.
> > We can certainly implement it as a local variable as long as we have access 
> > to the function this pass is operating on. I was thinking of its potential 
> > use throughout this pass in the future.
> You have access to the function, AI->getParent()->getParent().
> You also will not need to pass ORE everywhere in the subsequent patch, just 
> construct it in target in place.
Sounds like a plan!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106891

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

Reply via email to