Add a print method to the ObjC property object.
authorBill Wendling <isanbard@gmail.com>
Fri, 6 Jul 2012 19:12:31 +0000 (19:12 +0000)
committerBill Wendling <isanbard@gmail.com>
Fri, 6 Jul 2012 19:12:31 +0000 (19:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159848 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo.h
lib/VMCore/DebugInfo.cpp

index fdbafd69f29b7a92e4006504054b5833a091b6b6..618220fcb010d924852b8acd0972f7dc093184ea 100644 (file)
@@ -754,6 +754,8 @@ namespace llvm {
   };
 
   class DIObjCProperty : public DIDescriptor {
+    friend class DIDescriptor;
+    void printInternal(raw_ostream &OS) const;
   public:
     explicit DIObjCProperty(const MDNode *N) : DIDescriptor(N) { }
 
index d7144adcb098b314a24a7f6f2250ba09521d312e..bb700a94817b399fe9cde00ba15c4e021e514bec 100644 (file)
@@ -1018,6 +1018,8 @@ void DIDescriptor::print(raw_ostream &OS) const {
     DIGlobalVariable(DbgNode).printInternal(OS);
   } else if (this->isVariable()) {
     DIVariable(DbgNode).printInternal(OS);
+  } else if (this->isObjCProperty()) {
+    DIObjCProperty(DbgNode).printInternal(OS);
   }
 }
 
@@ -1121,6 +1123,15 @@ void DIVariable::printInternal(raw_ostream &OS) const {
   OS << " [line " << getLineNumber() << ']';
 }
 
+void DIObjCProperty::printInternal(raw_ostream &OS) const {
+  StringRef Name = getObjCPropertyName();
+  if (!Name.empty())
+    OS << " [" << Name << ']';
+
+  OS << " [line " << getLineNumber()
+     << ", properties " << getUnsignedField(6) << ']';
+}
+
 static void printDebugLoc(DebugLoc DL, raw_ostream &CommentOS,
                           const LLVMContext &Ctx) {
   if (!DL.isUnknown()) {          // Print source line info.