================
@@ -343,3 +348,32 @@ extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
 LLVMInitializeAVRAsmPrinter() {
   llvm::RegisterAsmPrinter<AVRAsmPrinter> X(getTheAVRTarget());
 }
+
+PreservedAnalyses AVRAsmPrinterBeginPass::run(Module &M,
+                                              ModuleAnalysisManager &MAM) {
+  AVRAsmPrinter &AsmPrinter = static_cast<AVRAsmPrinter &>(
+      MAM.getResult<AsmPrinterAnalysis>(M).getPrinter());
+  setupModuleAsmPrinter(M, MAM, AsmPrinter);
+  AsmPrinter.doInitialization(M);
+  return PreservedAnalyses::all();
+}
+
+PreservedAnalyses AVRAsmPrinterPass::run(MachineFunction &MF,
+                                         MachineFunctionAnalysisManager &MFAM) 
{
+  AVRAsmPrinter &AsmPrinter = static_cast<AVRAsmPrinter &>(
+      MFAM.getResult<ModuleAnalysisManagerMachineFunctionProxy>(MF)
+          .getCachedResult<AsmPrinterAnalysis>(*MF.getFunction().getParent())
----------------
boomanaiden154 wrote:

It's guaranteed to exist given nothing can invalidate it and we request it at 
the beginning of the pipeline. Although it wouldn't hurt to `assert` to 
explicitly call this out, but we need to do it in all the NewPM Target 
AsmPrinter implementations.

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

Reply via email to