diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-27 12:18:28 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-27 12:18:28 +0000 |
commit | 47d2145675099893d702be4bc06bd9f26d8ddd13 (patch) | |
tree | 4abaa188a49dcf3a12abf3a1484bb0e1d46926ad /lib/CodeGen | |
parent | 4a08268a6953b3ce77691d3a8a7589e7cdeea947 (diff) |
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
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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<BlockExpr>(E), FunctionName.c_str()); } + case Expr::CXXTypeidExprClass: { + CXXTypeidExpr *Typeid = cast<CXXTypeidExpr>(E); + QualType T; + if (Typeid->isTypeOperand()) + T = Typeid->getTypeOperand(); + else + T = Typeid->getExprOperand()->getType(); + return CGM.GetAddrOfRTTIDescriptor(T); + } } return 0; |