[cfe-commits] r128725 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenCXX/debug-info-template.cpp
Devang Patel
dpatel at apple.com
Fri Apr 1 12:02:33 PDT 2011
Author: dpatel
Date: Fri Apr 1 14:02:33 2011
New Revision: 128725
URL: http://llvm.org/viewvc/llvm-project?rev=128725&view=rev
Log:
Do not try calculate the size of forward-declared template type array.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/test/CodeGenCXX/debug-info-template.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=128725&r1=128724&r2=128725&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 1 14:02:33 2011
@@ -1226,6 +1226,14 @@
} else if (Ty->isIncompleteArrayType()) {
Size = 0;
Align = CGM.getContext().getTypeAlign(Ty->getElementType());
+ } else if (Ty->isDependentSizedArrayType()) {
+ Size = 0;
+ Align = 0;
+ } else if (Ty->getElementType()->getTypeClass()
+ == Type::TemplateSpecialization) {
+ // FIXME : Emit appropriate element type info.
+ Size = 0;
+ Align = 0;
} else {
// Size and align of the whole array, not the element type.
Size = CGM.getContext().getTypeSize(Ty);
Modified: cfe/trunk/test/CodeGenCXX/debug-info-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-template.cpp?rev=128725&r1=128724&r2=128725&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-template.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-template.cpp Fri Apr 1 14:02:33 2011
@@ -20,3 +20,13 @@
};
TU<2> u2;
+
+// PR9600
+template<typename T> class vector {};
+class Foo;
+typedef vector<Foo*> FooVector[3];
+struct Test {
+ virtual void foo(FooVector *);
+};
+static Test test;
+
More information about the cfe-commits
mailing list