gollvm: fix buglet in llvm-godumpspec

The code in llvm-godumpspec that inspects DWARF type information was
not allowing for the possibility of a benign "duplicate but identical"
typedef in C (allowed as a GNU extension). For example, it is possible
to see the following typedef

   typedef __gnuc_va_list va_list;

in both stdio.h and stdarg.h. Interestingly enough this can also
generated two DWARF entries (surprisingly), so to handle this scenario
in llvm-godumpspec, suppress the emission of a named type if we have
already emitted a type of the same name.

Updates golang/go#44223.

Change-Id: Idc3570c9905efa6c24f00c53a56645864218d1cd
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/291610
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
diff --git a/libgo/godumpspec/godumpspec.cpp b/libgo/godumpspec/godumpspec.cpp
index 4abf442..58d7bb7 100644
--- a/libgo/godumpspec/godumpspec.cpp
+++ b/libgo/godumpspec/godumpspec.cpp
@@ -408,6 +408,8 @@
   curDieOffset_ = invalidOffset;
 
   if (emit_ && cname != nullptr) {
+    if (emittedTypeNames_.find(cname) != emittedTypeNames_.end())
+      return;
     if (! ok)
       os() << "// ";
     else