Revert "DebugInfo: remove unused helper function getDICompositeType."
authorEric Christopher <echristo@gmail.com>
Tue, 9 Jul 2013 00:16:56 +0000 (00:16 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 9 Jul 2013 00:16:56 +0000 (00:16 +0000)
This reverts commit r185876 as the functions appear to still be used
by dragonegg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185890 91177308-0d34-0410-b5e6-96231b3b80d8

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

index dd03bf70d2c9aad2ac6c6aa8fbeeb14454f611c1..372d367b7075ec87f41edd1def186201d898ee64 100644 (file)
@@ -695,6 +695,9 @@ namespace llvm {
   /// getDISubprogram - Find subprogram that is enclosing this scope.
   DISubprogram getDISubprogram(const MDNode *Scope);
 
+  /// getDICompositeType - Find underlying composite type.
+  DICompositeType getDICompositeType(DIType T);
+
   /// isSubprogramContext - Return true if Context is either a subprogram
   /// or another context nested inside a subprogram.
   bool isSubprogramContext(const MDNode *Context);
index c55d68fdc74e92a3370d682ead66366c0428be67..25d4ea4fc2aa38ee37b832430586b9a06d20afa7 100644 (file)
@@ -844,6 +844,17 @@ DISubprogram llvm::getDISubprogram(const MDNode *Scope) {
   return DISubprogram();
 }
 
+/// getDICompositeType - Find underlying composite type.
+DICompositeType llvm::getDICompositeType(DIType T) {
+  if (T.isCompositeType())
+    return DICompositeType(T);
+
+  if (T.isDerivedType())
+    return getDICompositeType(DIDerivedType(T).getTypeDerivedFrom());
+
+  return DICompositeType();
+}
+
 /// isSubprogramContext - Return true if Context is either a subprogram
 /// or another context nested inside a subprogram.
 bool llvm::isSubprogramContext(const MDNode *Context) {