summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-12-27 12:18:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-12-27 12:18:28 +0000
commit6e52514c5deb9f2ce145228a55c5644539977489 (patch)
treec05283bd07ce0e4ca017c410d6a12e13db35f3c2 /clang/lib/CodeGen
parentb668401b2ea08a1f476b68b2b30aeb7b9d25f1ce (diff)
downloadbcm5719-llvm-6e52514c5deb9f2ce145228a55c5644539977489.tar.gz
bcm5719-llvm-6e52514c5deb9f2ce145228a55c5644539977489.zip
constexpr: support for evaluation and codegen of typeid constants.
llvm-svn: 147290
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 136b7139108..1bd94295d3f 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud