Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
flang/lib/Frontend/FrontendActions.cpp
Show First 20 Lines • Show All 535 Lines • ▼ Show 20 Lines | void CodeGenAction::generateLLVMIR() { | ||||
// Set-up the MLIR pass manager | // Set-up the MLIR pass manager | ||||
mlir::PassManager pm(mlirCtx.get(), mlir::OpPassManager::Nesting::Implicit); | mlir::PassManager pm(mlirCtx.get(), mlir::OpPassManager::Nesting::Implicit); | ||||
pm.addPass(std::make_unique<Fortran::lower::VerifierPass>()); | pm.addPass(std::make_unique<Fortran::lower::VerifierPass>()); | ||||
pm.enableVerifier(/*verifyPasses=*/true); | pm.enableVerifier(/*verifyPasses=*/true); | ||||
// Create the pass pipeline | // Create the pass pipeline | ||||
fir::createMLIRToLLVMPassPipeline(pm, level); | fir::createMLIRToLLVMPassPipeline(pm, opts.StackArrays, level); | ||||
mlir::applyPassManagerCLOptions(pm); | mlir::applyPassManagerCLOptions(pm); | ||||
// run the pass manager | // run the pass manager | ||||
if (!mlir::succeeded(pm.run(*mlirModule))) { | if (!mlir::succeeded(pm.run(*mlirModule))) { | ||||
unsigned diagID = ci.getDiagnostics().getCustomDiagID( | unsigned diagID = ci.getDiagnostics().getCustomDiagID( | ||||
clang::DiagnosticsEngine::Error, "Lowering to LLVM IR failed"); | clang::DiagnosticsEngine::Error, "Lowering to LLVM IR failed"); | ||||
ci.getDiagnostics().Report(diagID); | ci.getDiagnostics().Report(diagID); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 302 Lines • Show Last 20 Lines |