//===- StripGCRelocates.cpp - Remove gc.relocates inserted by RewriteStatePoints===// // // 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 // //===----------------------------------------------------------------------===// // // This is a little utility pass that removes the gc.relocates inserted by // RewriteStatepointsForGC. Note that the generated IR is incorrect, // but this is useful as a single pass in itself, for analysis of IR, without // the GC.relocates. The statepoint and gc.result intrinsics would still be // present. //===----------------------------------------------------------------------===// #include "llvm/Transforms/Utils/StripGCRelocates.h" #include "llvm/IR/Function.h" #include "llvm/IR/InstIterator.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Statepoint.h" usingnamespacellvm; static bool stripGCRelocates(Function &F) { … } PreservedAnalyses StripGCRelocates::run(Function &F, FunctionAnalysisManager &AM) { … }