[llvm-commits] [llvm-gcc-4.2] r94871 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Devang Patel
dpatel at apple.com
Fri Jan 29 17:09:30 PST 2010
Author: dpatel
Date: Fri Jan 29 19:09:30 2010
New Revision: 94871
URL: http://llvm.org/viewvc/llvm-project?rev=94871&view=rev
Log:
Emit debug info for class static variables.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=94871&r1=94870&r2=94871&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Jan 29 19:09:30 2010
@@ -897,6 +897,9 @@
// Should we skip.
if (DECL_P(Member) && DECL_IGNORED_P(Member)) continue;
+ // Get the location of the member.
+ expanded_location MemLoc = GetNodeLocation(Member, false);
+
if (TREE_CODE(Member) == FIELD_DECL) {
if (DECL_FIELD_OFFSET(Member) == 0 ||
@@ -910,9 +913,6 @@
|| TREE_CODE (TREE_TYPE (Member)) == RECORD_TYPE))
continue;
- // Get the location of the member.
- expanded_location MemLoc = GetNodeLocation(Member, false);
-
// Field type is the declared type of the field.
tree FieldNodeType = FieldType(Member);
DIType MemberType = getOrCreateType(FieldNodeType);
@@ -933,8 +933,14 @@
int_bit_position(Member),
MFlags, MemberType);
EltTys.push_back(DTy);
- } else {
- DEBUGASSERT(0 && "Unsupported member tree code!");
+ } if (TREE_CODE(Member) == VAR_DECL) {
+ EltTys.push_back(DebugFactory.
+ CreateVariable(DW_TAG_auto_variable,
+ findRegion(DECL_CONTEXT(Member)),
+ GetNodeName(Member),
+ getOrCreateCompileUnit(MemLoc.file),
+ MemLoc.line,
+ getOrCreateType(TREE_TYPE(Member))));
}
}
More information about the llvm-commits
mailing list