summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-03-29 08:42:56 +0000
committerEric Christopher <echristo@apple.com>2012-03-29 08:42:56 +0000
commit70e1bd8872a230d60c2fc2dd2bb19c7f16fcfce0 (patch)
treebd8ada307a2ad95bdb8d15cc51c7e5f3f5a240a4 /llvm/lib/Analysis
parent9ee2d338fb20a6070b757a54e057abf8fd19f441 (diff)
downloadbcm5719-llvm-70e1bd8872a230d60c2fc2dd2bb19c7f16fcfce0.tar.gz
bcm5719-llvm-70e1bd8872a230d60c2fc2dd2bb19c7f16fcfce0.zip
Add support for objc property decls according to the page at:
http://llvm.org/docs/SourceLevelDebugging.html#objcproperty including type and DECL. Expand the metadata needed accordingly. rdar://11144023 llvm-svn: 153639
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/DIBuilder.cpp11
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp13
2 files changed, 21 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DIBuilder.cpp b/llvm/lib/Analysis/DIBuilder.cpp
index f0bdc48cf3c..ddf57f84a86 100644
--- a/llvm/lib/Analysis/DIBuilder.cpp
+++ b/llvm/lib/Analysis/DIBuilder.cpp
@@ -385,16 +385,21 @@ DIType DIBuilder::createObjCIVar(StringRef Name,
/// createObjCProperty - Create debugging information entry for Objective-C
/// property.
-DIObjCProperty DIBuilder::createObjCProperty(StringRef Name,
+DIObjCProperty DIBuilder::createObjCProperty(StringRef Name,
+ DIFile File, unsigned LineNumber,
StringRef GetterName,
StringRef SetterName,
- unsigned PropertyAttributes) {
+ unsigned PropertyAttributes,
+ DIType Ty) {
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_APPLE_Property),
MDString::get(VMContext, Name),
+ File,
+ ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
MDString::get(VMContext, GetterName),
MDString::get(VMContext, SetterName),
- ConstantInt::get(Type::getInt32Ty(VMContext), PropertyAttributes)
+ ConstantInt::get(Type::getInt32Ty(VMContext), PropertyAttributes),
+ Ty
};
return DIObjCProperty(MDNode::get(VMContext, Elts));
}
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index e30c0a9b330..c9a619863b9 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -377,6 +377,19 @@ bool DICompileUnit::Verify() const {
return true;
}
+/// Verify - Verify that an ObjC property is well formed.
+bool DIObjCProperty::Verify() const {
+ if (!DbgNode)
+ return false;
+ unsigned Tag = getTag();
+ if (Tag != dwarf::DW_TAG_APPLE_Property) return false;
+ DIType Ty = getType();
+ if (!Ty.Verify()) return false;
+
+ // Don't worry about the rest of the strings for now.
+ return true;
+}
+
/// Verify - Verify that a type descriptor is well formed.
bool DIType::Verify() const {
if (!DbgNode)
OpenPOWER on IntegriCloud