aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/FreeMachineFunction.cpp
blob: f38f3e63a3f37a9765468bc0f299e532a71b1fd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//===- FreeMachineFunction.cpp --------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/CodeGen/FreeMachineFunction.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfo.h"

using namespace llvm;

PreservedAnalyses
FreeMachineFunctionPass::run(MachineFunction &MF,
                             MachineFunctionAnalysisManager &MFAM) {
  auto &MMI = MF.getMMI();
  MFAM.invalidate(MF, PreservedAnalyses::none());
  MMI.deleteMachineFunctionFor(MF.getFunction()); // MF is dangling now.
  return PreservedAnalyses::none();
}