[llvm-branch-commits] [AVR] Port AsmPrinter to NewPM (PR #236491)
Aiden Grossman via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Nov 5 17:16:55 PST 2026
================
@@ -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
More information about the llvm-branch-commits
mailing list