From 47d2145675099893d702be4bc06bd9f26d8ddd13 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 27 Dec 2011 12:18:28 +0000 Subject: constexpr: support for evaluation and codegen of typeid constants. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147290 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprConstant.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/CodeGen/CGExprConstant.cpp') diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 136b713910..1bd94295d3 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -934,6 +934,15 @@ public: return CGM.GetAddrOfGlobalBlock(cast(E), FunctionName.c_str()); } + case Expr::CXXTypeidExprClass: { + CXXTypeidExpr *Typeid = cast(E); + QualType T; + if (Typeid->isTypeOperand()) + T = Typeid->getTypeOperand(); + else + T = Typeid->getExprOperand()->getType(); + return CGM.GetAddrOfRTTIDescriptor(T); + } } return 0; -- cgit v1.2.3