diff options
author | Devang Patel <dpatel@apple.com> | 2009-06-23 22:07:48 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-06-23 22:07:48 +0000 |
commit | 0de4fa621e60a542d9bd43c09bd596ba452f035c (patch) | |
tree | 579ca8c02005b5ebb944193b2913142b02953f38 | |
parent | ecc63f8687c4eb746b69336316685fe9b224adfb (diff) |
Add DISubprogram::getReturnTypeName()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74015 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index 972bb07196..2b7b2b7cdf 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -330,6 +330,19 @@ namespace llvm { 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; |