summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2012-02-04 00:59:25 +0000
committerDevang Patel <dpatel@apple.com>2012-02-04 00:59:25 +0000
commitcc481596e4b8a4b1541d500cfe2e098c611a1c98 (patch)
tree00691d159c8b4251b7eb61c8298dfdcb1b083871 /llvm/lib/Analysis
parent130bbd0302112013dd831a56f8bdacfcf7064d48 (diff)
downloadbcm5719-llvm-cc481596e4b8a4b1541d500cfe2e098c611a1c98.tar.gz
bcm5719-llvm-cc481596e4b8a4b1541d500cfe2e098c611a1c98.zip
Introduce DIObjCProperty. This will be used to encode objective-c property.
llvm-svn: 149732
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/DIBuilder.cpp16
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp4
2 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DIBuilder.cpp b/llvm/lib/Analysis/DIBuilder.cpp
index 5e94d899b9e..ee7ecd1b052 100644
--- a/llvm/lib/Analysis/DIBuilder.cpp
+++ b/llvm/lib/Analysis/DIBuilder.cpp
@@ -359,6 +359,22 @@ DIType DIBuilder::createObjCIVar(StringRef Name,
return DIType(MDNode::get(VMContext, Elts));
}
+/// createObjCProperty - Create debugging information entry for Objective-C
+/// property.
+DIObjCProperty DIBuilder::createObjCProperty(StringRef Name,
+ StringRef GetterName,
+ StringRef SetterName,
+ unsigned PropertyAttributes) {
+ Value *Elts[] = {
+ GetTagConstant(VMContext, dwarf::DW_TAG_APPLE_Property),
+ MDString::get(VMContext, Name),
+ MDString::get(VMContext, GetterName),
+ MDString::get(VMContext, SetterName),
+ ConstantInt::get(Type::getInt32Ty(VMContext), PropertyAttributes)
+ };
+ return DIObjCProperty(MDNode::get(VMContext, Elts));
+}
+
/// createClassType - Create debugging information entry for a class.
DIType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
DIFile File, unsigned LineNumber,
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index f925b5ca43a..a2d2c5f5803 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -289,6 +289,10 @@ bool DIDescriptor::isEnumerator() const {
return DbgNode && getTag() == dwarf::DW_TAG_enumerator;
}
+/// isObjCProperty - Return true if the specified tag is DW_TAG
+bool DIDescriptor::isObjCProperty() const {
+ return DbgNode && getTag() == dwarf::DW_TAG_APPLE_Property;
+}
//===----------------------------------------------------------------------===//
// Simple Descriptor Constructors and other Methods
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud