llvm/llvm/include/llvm/ADT/GenericSSAContext.h

//===- GenericSSAContext.h --------------------------------------*- 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
//
//===----------------------------------------------------------------------===//
/// \file
///
/// This file defines the little GenericSSAContext<X> template class
/// that can be used to implement IR analyses as templates.
/// Specializing these templates allows the analyses to be used over
/// both LLVM IR and Machine IR.
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_ADT_GENERICSSACONTEXT_H
#define LLVM_ADT_GENERICSSACONTEXT_H

#include "llvm/Support/Printable.h"

namespace llvm {

template <typename, bool> class DominatorTreeBase;
template <typename> class SmallVectorImpl;

namespace Intrinsic {
ID;
}

// Specializations of this template should provide the types used by the
// template GenericSSAContext below.
template <typename _FunctionT> struct GenericSSATraits;

// Ideally this should have been a stateless traits class. But the print methods
// for Machine IR need access to the owning function. So we track that state in
// the template itself.
//
// We use FunctionT as a template argument and not GenericSSATraits to allow
// forward declarations using well-known typenames.
template <typename _FunctionT> class GenericSSAContext {};
} // namespace llvm

#endif // LLVM_ADT_GENERICSSACONTEXT_H