Add IR generation support for SizeOfPackExpr.

llvm-svn: 123332
This commit is contained in:
Douglas Gregor
2011-01-12 22:11:34 +00:00
parent ab2ecacee1
commit be7b54889f
2 changed files with 17 additions and 0 deletions

View File

@@ -195,6 +195,11 @@ public:
return Builder.CreateBitCast(V, ConvertType(E->getType()));
}
Value *VisitSizeOfPackExpr(SizeOfPackExpr *E) {
return llvm::ConstantInt::get(ConvertType(E->getType()),
E->getPackLength());
}
// l-values.
Value *VisitDeclRefExpr(DeclRefExpr *E) {
Expr::EvalResult Result;

View File

@@ -0,0 +1,12 @@
// RUN: %clang_cc1 -std=c++0x -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
template<typename ...Types>
int get_num_types(Types...) {
return sizeof...(Types);
}
// CHECK: define weak_odr i32 @_Z13get_num_typesIJifdEEispT_
// CHECK: ret i32 3
template int get_num_types(int, float, double);