From 2e8edd78b50e16852db1dacc5ffaac0432628c5c Mon Sep 17 00:00:00 2001 From: Jonathan Haslam Date: Wed, 31 Jan 2024 09:40:39 -0800 Subject: [PATCH] stub clang::BuiltinType::NullPtr primitive type Summary: Adding support for the nullptr clang type (clang::BuiltinType::NullPtr). While there I augmented the exception message to include the type name that is missing. Differential Revision: D53272742 --- oi/type_graph/ClangTypeParser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oi/type_graph/ClangTypeParser.cpp b/oi/type_graph/ClangTypeParser.cpp index c36fad7..9dc9ef4 100644 --- a/oi/type_graph/ClangTypeParser.cpp +++ b/oi/type_graph/ClangTypeParser.cpp @@ -405,10 +405,15 @@ Primitive& ClangTypeParser::enumeratePrimitive(const clang::BuiltinType& ty) { case clang::BuiltinType::LongDouble: return makeType(ty, Primitive::Kind::Float64); + case clang::BuiltinType::NullPtr: + return makeType(ty, Primitive::Kind::StubbedPointer); + case clang::BuiltinType::UInt128: case clang::BuiltinType::Int128: default: - throw std::logic_error(std::string("unsupported BuiltinType::Kind")); + throw std::logic_error(std::string("unsupported BuiltinType::Kind") + + " " + + ty.getNameAsCString(ast->getPrintingPolicy())); } }