diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h --- a/llvm/include/llvm/Support/Casting.h +++ b/llvm/include/llvm/Support/Casting.h @@ -525,6 +525,13 @@ } }; +template struct CastInfo { + static bool isPossible(const T &t) { return true; } + static decltype(auto) doCast(const T &t) { return t; } + static decltype(auto) castFailed() { return T(nullptr); } + static decltype(auto) doCastIfPossible(const T &t) { return t; } +}; + //===----------------------------------------------------------------------===// // Pre-specialized CastInfo //===----------------------------------------------------------------------===//