From: Anders Carlsson Date: Mon, 29 Oct 2007 02:59:40 +0000 (+0000) Subject: Generate code for __builtin_classify_type. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89799cf254c91ca110f113a33eebe8b1b4d1a761;p=clang Generate code for __builtin_classify_type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43429 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CodeGen/CGBuiltin.cpp b/CodeGen/CGBuiltin.cpp index 2ca84e25d4..ecac12b1f4 100644 --- a/CodeGen/CGBuiltin.cpp +++ b/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); }