aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-03-19 00:23:53 +0000
committerDevang Patel <dpatel@apple.com>2009-03-19 00:23:53 +0000
commitc20482b10ee4ffcea31f67392743ccdf6df1f7f4 (patch)
tree036161eee362c96025ac3030bed825353f65b7b6 /lib
parent9499a2e57f999b88ca1ed5981d7abcbd58748d61 (diff)
Encode ivar access control info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp12
1 files changed, 10 insertions, 2 deletions
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);
}