From c20482b10ee4ffcea31f67392743ccdf6df1f7f4 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 19 Mar 2009 00:23:53 +0000 Subject: Encode ivar access control info. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67267 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index cec39fd71a..ebf403038e 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -73,6 +73,8 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) { // 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 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, 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); } -- cgit v1.2.3-18-g5258