As part of the ongoing work in finalizing the accelerator tables, extend
the debug type accelerator tables to contain the tag and a flag
stating whether or not a compound type is a complete type.

rdar://10652330

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147651 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index f43a5bf..e499d2c 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -13,6 +13,7 @@
 
 #define DEBUG_TYPE "dwarfdebug"
 
+#include "DwarfAccelTable.h"
 #include "DwarfCompileUnit.h"
 #include "DwarfDebug.h"
 #include "llvm/Constants.h"
@@ -608,8 +609,20 @@
   }
   // If this is a named finished type then include it in the list of types
   // for the accelerator tables.
-  if (!Ty.getName().empty() && !Ty.isForwardDecl())
-    addAccelType(Ty.getName(), TyDIE);
+  if (!Ty.getName().empty() && !Ty.isForwardDecl()) {
+    bool IsImplementation = 0;
+    if (Ty.isCompositeType()) {
+      DICompositeType CT(Ty);
+      IsImplementation = (CT.getRunTimeLang() == 0) ||
+        CT.isObjcClassComplete();;
+    }
+    
+    addAccelType(Ty.getName(),
+                 std::make_pair(TyDIE,
+                                (IsImplementation ?
+                               DwarfAccelTable::eTypeFlagClassIsImplementation :
+                                 0)));
+  }
   
   addToContextOwner(TyDIE, Ty.getContext());
   return TyDIE;