[llvm-branch-commits] [cfe-branch] r118541 - in /cfe/branches/Apple/whitney: lib/CodeGen/Mangle.cpp test/CodeGenCXX/mangle.cpp
Daniel Dunbar
daniel at zuster.org
Tue Nov 9 09:30:40 PST 2010
Author: ddunbar
Date: Tue Nov 9 11:30:40 2010
New Revision: 118541
URL: http://llvm.org/viewvc/llvm-project?rev=118541&view=rev
Log:
Merge r118019:
--
Author: Fariborz Jahanian <fjahanian at apple.com>
Date: Tue Nov 2 16:54:00 2010 +0000
Fix a crash mangling decayed val argument-typed function.
// rdar: //8620510 and PR7666
Modified:
cfe/branches/Apple/whitney/lib/CodeGen/Mangle.cpp
cfe/branches/Apple/whitney/test/CodeGenCXX/mangle.cpp
Modified: cfe/branches/Apple/whitney/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/CodeGen/Mangle.cpp?rev=118541&r1=118540&r2=118541&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/CodeGen/Mangle.cpp (original)
+++ cfe/branches/Apple/whitney/lib/CodeGen/Mangle.cpp Tue Nov 9 11:30:40 2010
@@ -1324,7 +1324,9 @@
}
void CXXNameMangler::mangleType(const VariableArrayType *T) {
Out << 'A';
- mangleExpression(T->getSizeExpr());
+ // decayed vla types (size 0) will just be skipped.
+ if (T->getSizeExpr())
+ mangleExpression(T->getSizeExpr());
Out << '_';
mangleType(T->getElementType());
}
Modified: cfe/branches/Apple/whitney/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/CodeGenCXX/mangle.cpp?rev=118541&r1=118540&r2=118541&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/branches/Apple/whitney/test/CodeGenCXX/mangle.cpp Tue Nov 9 11:30:40 2010
@@ -624,3 +624,9 @@
template <class T> void test1(decltype(f<>(T()))) {}
template void test1<int>(decltype(f<>(int())));
}
+
+// rdar:// 8620510
+namespace test21 {
+ // CHECK: define void @_ZN6test2112vla_arg_funcEiPA_i(
+ void vla_arg_func(int X, int a[X][X]) {}
+}
More information about the llvm-branch-commits
mailing list