llvm/clang/include/clang/CodeGen/ConstantInitFuture.h

//===- ConstantInitFuture.h - "Future" constant initializers ----*- 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 class defines the ConstantInitFuture class.  This is split out
// from ConstantInitBuilder.h in order to allow APIs to work with it
// without having to include that entire header.  This is particularly
// important because it is often useful to be able to default-construct
// a future in, say, a default argument.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_CODEGEN_CONSTANTINITFUTURE_H
#define LLVM_CLANG_CODEGEN_CONSTANTINITFUTURE_H

#include "llvm/ADT/PointerUnion.h"
#include "llvm/IR/Constant.h"

// Forward-declare ConstantInitBuilderBase and give it a
// PointerLikeTypeTraits specialization so that we can safely use it
// in a PointerUnion below.
namespace clang {
namespace CodeGen {
class ConstantInitBuilderBase;
}
}
namespace llvm {
template <>
struct PointerLikeTypeTraits< ::clang::CodeGen::ConstantInitBuilderBase*> {};
}

namespace clang {
namespace CodeGen {

/// A "future" for a completed constant initializer, which can be passed
/// around independently of any sub-builders (but not the original parent).
class ConstantInitFuture {};

}  // end namespace CodeGen
}  // end namespace clang

namespace llvm {

template <>
struct PointerLikeTypeTraits< ::clang::CodeGen::ConstantInitFuture> {};

} // end namespace llvm

#endif