[cfe-commits] r124756 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenCXX/debug-info-template.cpp
Devang Patel
dpatel at apple.com
Wed Feb 2 14:36:18 PST 2011
Author: dpatel
Date: Wed Feb 2 16:36:18 2011
New Revision: 124756
URL: http://llvm.org/viewvc/llvm-project?rev=124756&view=rev
Log:
Emit debug info for template value parameters.
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=124756&r1=124755&r2=124756&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Feb 2 16:36:18 2011
@@ -967,6 +967,13 @@
llvm::DITemplateTypeParameter TTP =
DBuilder.CreateTemplateTypeParameter(TheCU, TTy.getName(), TTy);
TemplateParams.push_back(TTP);
+ } else if (TA.getKind() == TemplateArgument::Integral) {
+ llvm::DIType TTy = getOrCreateType(TA.getIntegralType(), Unit);
+ // FIXME: Get parameter name, instead of parameter type name.
+ llvm::DITemplateValueParameter TVP =
+ DBuilder.CreateTemplateValueParameter(TheCU, TTy.getName(), TTy,
+ TA.getAsIntegral()->getZExtValue());
+ TemplateParams.push_back(TVP);
}
}
}
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=124756&r1=124755&r2=124756&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-template.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-template.cpp Wed Feb 2 16:36:18 2011
@@ -11,3 +11,12 @@
};
TC<int> tci;
+
+//CHECK: TU<2>
+//CHECK: DW_TAG_template_value_parameter
+template<unsigned >
+class TU {
+ int b;
+};
+
+TU<2> u2;
More information about the cfe-commits
mailing list