clang 20.0.0 (based on r547379) from build 12806354. Bug: http://b/379133546 Test: N/A Change-Id: I2eb8938af55d809de674be63cb30cf27e801862b Upstream-Commit: ad834e67b1105d15ef907f6255d4c96e8e733f57
49 lines
1.7 KiB
C++
49 lines
1.7 KiB
C++
//===- SafepointIRVerifier.h - Checks for GC relocation problems *- C++ -*-===//
|
|
//
|
|
// 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 file defines a verifier which is useful for enforcing the relocation
|
|
// properties required by a relocating GC. Specifically, it looks for uses of
|
|
// the unrelocated value of pointer SSA values after a possible safepoint. It
|
|
// attempts to report no false negatives, but may end up reporting false
|
|
// positives in rare cases (see the note at the top of the corresponding cpp
|
|
// file.)
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_IR_SAFEPOINTIRVERIFIER_H
|
|
#define LLVM_IR_SAFEPOINTIRVERIFIER_H
|
|
|
|
#include "llvm/IR/PassManager.h"
|
|
|
|
namespace llvm {
|
|
|
|
class Function;
|
|
class FunctionPass;
|
|
|
|
/// Run the safepoint verifier over a single function. Crashes on failure.
|
|
void verifySafepointIR(Function &F);
|
|
|
|
/// Create an instance of the safepoint verifier pass which can be added to
|
|
/// a pass pipeline to check for relocation bugs.
|
|
FunctionPass *createSafepointIRVerifierPass();
|
|
|
|
/// Create an instance of the safepoint verifier pass which can be added to
|
|
/// a pass pipeline to check for relocation bugs.
|
|
class SafepointIRVerifierPass : public PassInfoMixin<SafepointIRVerifierPass> {
|
|
|
|
public:
|
|
explicit SafepointIRVerifierPass() = default;
|
|
|
|
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
|
|
|
|
static bool isRequired() { return true; }
|
|
};
|
|
}
|
|
|
|
#endif // LLVM_IR_SAFEPOINTIRVERIFIER_H
|