Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | //===- SafepointIRVerifier.h - Checks for GC relocation problems *- C++ -*-===// |
| 2 | // |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame] | 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 |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file defines a verifier which is useful for enforcing the relocation |
| 10 | // properties required by a relocating GC. Specifically, it looks for uses of |
| 11 | // the unrelocated value of pointer SSA values after a possible safepoint. It |
| 12 | // attempts to report no false negatives, but may end up reporting false |
| 13 | // positives in rare cases (see the note at the top of the corresponding cpp |
| 14 | // file.) |
| 15 | // |
| 16 | //===----------------------------------------------------------------------===// |
| 17 | |
| 18 | #ifndef LLVM_IR_SAFEPOINT_IR_VERIFIER |
| 19 | #define LLVM_IR_SAFEPOINT_IR_VERIFIER |
| 20 | |
| 21 | namespace llvm { |
| 22 | |
| 23 | class Function; |
| 24 | class FunctionPass; |
| 25 | |
| 26 | /// Run the safepoint verifier over a single function. Crashes on failure. |
| 27 | void verifySafepointIR(Function &F); |
| 28 | |
| 29 | /// Create an instance of the safepoint verifier pass which can be added to |
| 30 | /// a pass pipeline to check for relocation bugs. |
| 31 | FunctionPass *createSafepointIRVerifierPass(); |
| 32 | } |
| 33 | |
| 34 | #endif // LLVM_IR_SAFEPOINT_IR_VERIFIER |