[cfe-commits] r67267 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Devang Patel
dpatel at apple.com
Wed Mar 18 17:23:53 PDT 2009
Author: dpatel
Date: Wed Mar 18 19:23:53 2009
New Revision: 67267
URL: http://llvm.org/viewvc/llvm-project?rev=67267&view=rev
Log:
Encode ivar access control info.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=67267&r1=67266&r2=67267&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Mar 18 19:23:53 2009
@@ -73,6 +73,8 @@
// Create new compile unit.
// FIXME: Handle other language IDs as well.
// FIXME: Do not know how to get clang version yet.
+ // FIXME: Encode command line options.
+ // FIXME: Encode optimization level.
return Unit = DebugFactory.CreateCompileUnit(llvm::dwarf::DW_LANG_C89,
FileName, DirName, "clang",
isMain);
@@ -370,14 +372,20 @@
uint64_t FieldSize = M->getContext().getTypeSize(Ty);
unsigned FieldAlign = M->getContext().getTypeAlign(Ty);
uint64_t FieldOffset = RL.getFieldOffset(FieldNo);
-
+
+ unsigned Flags = 0;
+ if (Field->getAccessControl() == ObjCIvarDecl::Protected)
+ Flags = llvm::DIType::FlagProtected;
+ else if (Field->getAccessControl() == ObjCIvarDecl::Private)
+ Flags = llvm::DIType::FlagPrivate;
+
// Create a DW_TAG_member node to remember the offset of this field in the
// struct. FIXME: This is an absolutely insane way to capture this
// information. When we gut debug info, this should be fixed.
FieldTy = DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_member, Unit,
FieldName, FieldDefUnit,
FieldLine, FieldSize, FieldAlign,
- FieldOffset, 0, FieldTy);
+ FieldOffset, Flags, FieldTy);
EltTys.push_back(FieldTy);
}
More information about the cfe-commits
mailing list