[llvm-commits] [llvm] r74015 - /llvm/trunk/include/llvm/Analysis/DebugInfo.h

Devang Patel dpatel at apple.com
Tue Jun 23 15:07:48 PDT 2009


Author: dpatel
Date: Tue Jun 23 17:07:48 2009
New Revision: 74015

URL: http://llvm.org/viewvc/llvm-project?rev=74015&view=rev
Log:
Add DISubprogram::getReturnTypeName()

Modified:
    llvm/trunk/include/llvm/Analysis/DebugInfo.h

Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=74015&r1=74014&r2=74015&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Tue Jun 23 17:07:48 2009
@@ -330,6 +330,19 @@
 
     DICompositeType getType() const { return getFieldAs<DICompositeType>(8); }
 
+    /// getReturnTypeName - Subprogram return types are encoded either as
+    /// DIType or as DICompositeType.
+    const std::string &getReturnTypeName(std::string &F) const {
+      DICompositeType DCT(getFieldAs<DICompositeType>(8));
+      if (!DCT.isNull()) {
+        DIArray A = DCT.getTypeArray();
+        DIType T(A.getElement(0).getGV());
+        return T.getName(F);
+      }
+      DIType T(getFieldAs<DIType>(8));
+      return T.getName(F);
+    }
+
     /// Verify - Verify that a subprogram descriptor is well formed.
     bool Verify() const;
 





More information about the llvm-commits mailing list