[llvm] [CodeGen] Port DwarfEHPrepare to new pass manager (PR #72500)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 27 17:52:23 PST 2023
================
@@ -365,6 +366,26 @@ class DwarfEHPrepareLegacyPass : public FunctionPass {
} // end anonymous namespace
+PreservedAnalyses DwarfEHPreparePass::run(Function &F,
+ FunctionAnalysisManager &FAM) {
+ const auto &TLI = *TM->getSubtargetImpl(F)->getTargetLowering();
+ auto *DT = FAM.getCachedResult<DominatorTreeAnalysis>(F);
+ const TargetTransformInfo *TTI = nullptr;
+ if (OptLevel != CodeGenOptLevel::None) {
+ if (!DT)
+ DT = &FAM.getResult<DominatorTreeAnalysis>(F);
+ TTI = &FAM.getResult<TargetIRAnalysis>(F);
+ }
+ bool Changed =
+ prepareDwarfEH(OptLevel, F, TLI, DT, TTI, TM->getTargetTriple());
----------------
paperchalice wrote:
The [getTargetTriple](https://llvm.org/doxygen/classllvm_1_1Module.html#a6b882824580b4666f692474ecbae56ad) method in `Module` returns `std::string` rather than `Triple`.
https://github.com/llvm/llvm-project/pull/72500
More information about the llvm-commits
mailing list