From ceced4ca730cd3378174bb9bab30454cfcfe027f Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Mon, 29 Oct 2007 02:59:40 +0000 Subject: [PATCH] Generate code for __builtin_classify_type. llvm-svn: 43429 --- clang/CodeGen/CGBuiltin.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/CodeGen/CGBuiltin.cpp b/clang/CodeGen/CGBuiltin.cpp index 2ca84e25d446..ecac12b1f4b3 100644 --- a/clang/CodeGen/CGBuiltin.cpp +++ b/clang/CodeGen/CGBuiltin.cpp @@ -63,7 +63,15 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) { return RValue::get(V); } + case Builtin::BI__builtin_classify_type: { + llvm::APSInt Result(32); + + if (!E->isBuiltinClassifyType(Result)) + assert(0 && "Expr not __builtin_classify_type!"); + + return RValue::get(llvm::ConstantInt::get(Result)); } - + } + return RValue::get(0); }