1 | //===- FreeMachineFunction.cpp --------------------------------------------===// |
---|---|
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #include "llvm/CodeGen/FreeMachineFunction.h" |
10 | #include "llvm/CodeGen/MachineFunction.h" |
11 | #include "llvm/CodeGen/MachineModuleInfo.h" |
12 | |
13 | using namespace llvm; |
14 | |
15 | PreservedAnalyses |
16 | FreeMachineFunctionPass::run(MachineFunction &MF, |
17 | MachineFunctionAnalysisManager &MFAM) { |
18 | auto &MMI = MF.getMMI(); |
19 | MFAM.invalidate(IR&: MF, PA: PreservedAnalyses::none()); |
20 | MMI.deleteMachineFunctionFor(F&: MF.getFunction()); // MF is dangling now. |
21 | return PreservedAnalyses::none(); |
22 | } |
23 |