r189600 - Debug Info: generate a unique identifier for C++ struct, class, union, and enum.

David Blaikie dblaikie at gmail.com
Thu Aug 29 14:18:22 PDT 2013


On Thu, Aug 29, 2013 at 11:51 AM, Manman Ren <manman.ren at gmail.com> wrote:
> Author: mren
> Date: Thu Aug 29 13:51:51 2013
> New Revision: 189600
>
> URL: http://llvm.org/viewvc/llvm-project?rev=189600&view=rev
> Log:
> Debug Info: generate a unique identifier for C++ struct, class, union, and enum.
>
> We use CXX mangler to generate unique identifier for external C++ struct,
> union, class and enum. Types with unique identifier are added to RetainedTypes
> to make sure they are treated as used even when all uses are replaced with
> the identifiers.
>
> A single type can be added to RetainedTypes multiple times. For example, both
> createForwardDecl and createLimitedType can add the same type to RetainedTypes.
> A set is used to avoid duplication when updating AllRetainTypes in DIBuilder.
>
> Testing cases are updated to reflect the unique identifier generated for types.
> The order of MDNodes is changed because of retained types and testing cases
> are updated accordingly.
>
> Testing case debug-info-uuid.cpp now emits error with Itanium mangler, since
> uuid is not yet handled in Itanium mangler.
>
> We choose to update RetainedTypes in clang, then at finalize(), we update
> AllRetainTypes in DIBuilder. The other choice is to update AllRetainTypes
> in DIBuilder when creating a DICompositeType with unique identifier. This
> option requires using ValueHandle for AllRetainTypes in DIBuilder since
> the created DICompositeType can be modified later on by setContainingType etc.
>
> Modified:
>     cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-artificial-arg.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-class.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-decl-nested.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-enum.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-method.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-template-limit.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-template-quals.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-template.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-union-template.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info-uuid.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Aug 29 13:51:51 2013
> @@ -599,6 +599,29 @@ llvm::DIType CGDebugInfo::CreateType(con
>                                 Ty->getPointeeType(), Unit);
>  }
>
> +/// In C++ mode, types have linkage, so we can rely on the ODR and
> +/// on their mangled names, if they're external. Otherwise, we append
> +/// the CU's directory and file name.
> +static void getUniqueTagTypeName(const TagType *Ty, CodeGenModule &CGM,
> +                                 llvm::DICompileUnit TheCU,
> +                                 SmallString<256> &FullName) {
> +  // FIXME: ODR should apply to ObjC++ exactly the same wasy it does to C++.
> +  // For now, only apply ODR with C++.
> +  const TagDecl *TD = Ty->getDecl();
> +  if (TheCU.getLanguage() != llvm::dwarf::DW_LANG_C_plus_plus ||
> +      !TD->isExternallyVisible())
> +    return;
> +  // Microsoft Mangler does not have support for mangleCXXRTTIName yet.
> +  if (CGM.getTarget().getCXXABI().isMicrosoft())
> +    return;
> +
> +  // TODO: This is using the RTTI name. Is there a better way to get
> +  // a unique string for a type?
> +  llvm::raw_svector_ostream Out(FullName);
> +  CGM.getCXXABI().getMangleContext().mangleCXXRTTIName(QualType(Ty, 0), Out);
> +  Out.flush();
> +}
> +
>  // Creates a forward declaration for a RecordDecl in the given context.
>  llvm::DICompositeType
>  CGDebugInfo::getOrCreateRecordFwdDecl(const RecordType *Ty,
> @@ -621,7 +644,14 @@ CGDebugInfo::getOrCreateRecordFwdDecl(co
>    }
>
>    // Create the type.
> -  return DBuilder.createForwardDecl(Tag, RDName, Ctx, DefUnit, Line);
> +  SmallString<256> FullName;
> +  getUniqueTagTypeName(Ty, CGM, TheCU, FullName);
> +  if (!FullName.empty()) {
> +    QualType QTy(Ty, 0);
> +    RetainedTypes.push_back(QTy.getAsOpaquePtr());
> +  }
> +  return DBuilder.createForwardDecl(Tag, RDName, Ctx, DefUnit, Line, 0, 0, 0,
> +                                    FullName.str());
>  }
>
>  // Walk up the context chain and create forward decls for record decls,
> @@ -1884,6 +1914,13 @@ llvm::DIType CGDebugInfo::CreateEnumType
>      Align = CGM.getContext().getTypeAlign(ED->getTypeForDecl());
>    }
>
> +  SmallString<256> FullName;
> +  getUniqueTagTypeName(Ty, CGM, TheCU, FullName);
> +  if (!FullName.empty()) {
> +    QualType QTy(Ty, 0);
> +    RetainedTypes.push_back(QTy.getAsOpaquePtr());
> +  }
> +
>    // If this is just a forward declaration, construct an appropriately
>    // marked node and just return it.
>    if (!ED->getDefinition()) {
> @@ -1894,7 +1931,7 @@ llvm::DIType CGDebugInfo::CreateEnumType
>      StringRef EDName = ED->getName();
>      return DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_enumeration_type,
>                                        EDName, EDContext, DefUnit, Line, 0,
> -                                      Size, Align);
> +                                      Size, Align, FullName.str());
>    }
>
>    // Create DIEnumerator elements for each enumerator.
> @@ -1920,7 +1957,7 @@ llvm::DIType CGDebugInfo::CreateEnumType
>    llvm::DIType DbgTy =
>      DBuilder.createEnumerationType(EnumContext, ED->getName(), DefUnit, Line,
>                                     Size, Align, EltArray,
> -                                   ClassTy);
> +                                   ClassTy, FullName.str());
>    return DbgTy;
>  }
>
> @@ -2270,20 +2307,28 @@ llvm::DICompositeType CGDebugInfo::Creat
>    uint64_t Align = CGM.getContext().getTypeAlign(Ty);
>    llvm::DICompositeType RealDecl;
>
> +  SmallString<256> FullName;
> +  getUniqueTagTypeName(Ty, CGM, TheCU, FullName);
> +  if (!FullName.empty()) {
> +    QualType QTy(Ty, 0);
> +    RetainedTypes.push_back(QTy.getAsOpaquePtr());
> +  }
> +
>    if (RD->isUnion())
>      RealDecl = DBuilder.createUnionType(RDContext, RDName, DefUnit, Line,
> -                                        Size, Align, 0, llvm::DIArray());
> +                                        Size, Align, 0, llvm::DIArray(), 0,
> +                                        FullName.str());
>    else if (RD->isClass()) {
>      // FIXME: This could be a struct type giving a default visibility different
>      // than C++ class type, but needs llvm metadata changes first.
>      RealDecl = DBuilder.createClassType(RDContext, RDName, DefUnit, Line,
>                                          Size, Align, 0, 0, llvm::DIType(),
>                                          llvm::DIArray(), llvm::DIType(),
> -                                        llvm::DIArray());
> +                                        llvm::DIArray(), FullName.str());
>    } else
>      RealDecl = DBuilder.createStructType(RDContext, RDName, DefUnit, Line,
>                                           Size, Align, 0, llvm::DIType(),
> -                                         llvm::DIArray());
> +                                         llvm::DIArray(), 0, 0, FullName.str());
>
>    RegionMap[Ty->getDecl()] = llvm::WeakVH(RealDecl);
>    TypeCache[QualType(Ty, 0).getAsOpaquePtr()] = RealDecl;
> @@ -3290,9 +3335,17 @@ void CGDebugInfo::finalize() {
>
>    // We keep our own list of retained types, because we need to look
>    // up the final type in the type cache.
> +  // Both createForwardDecl and createLimitedType can add the same type to
> +  // RetainedTypes. A set is used to avoid duplication.
> +  llvm::SmallPtrSet<void *, 16> RetainSet;
>    for (std::vector<void *>::const_iterator RI = RetainedTypes.begin(),
>           RE = RetainedTypes.end(); RI != RE; ++RI)
> -    DBuilder.retainType(llvm::DIType(cast<llvm::MDNode>(TypeCache[*RI])));
> +    if (RetainSet.insert(*RI)) {
> +      llvm::DenseMap<void *, llvm::WeakVH>::iterator it =
> +        TypeCache.find(*RI);
> +      if (it != TypeCache.end() && it->second)
> +        DBuilder.retainType(llvm::DIType(cast<llvm::MDNode>(it->second)));
> +    }
>
>    DBuilder.finalize();
>  }
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-artificial-arg.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-artificial-arg.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-artificial-arg.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-artificial-arg.cpp Thu Aug 29 13:51:51 2013
> @@ -22,8 +22,8 @@ int main(int argc, char **argv) {
>    A reallyA (500);
>  }
>
> -// CHECK: ![[ARTARG:.*]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from A]
>  // CHECK: ![[CLASSTYPE:.*]] = {{.*}} ; [ DW_TAG_class_type ] [A]
> +// CHECK: ![[ARTARG:.*]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from A]
>  // CHECK: metadata ![[CLASSTYPE]], {{.*}} ; [ DW_TAG_subprogram ] [line 12] [A]
>  // CHECK: metadata [[FUNCTYPE:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
>  // CHECK: [[FUNCTYPE]] = metadata !{null, metadata ![[ARTARG]], metadata !{{.*}}, metadata !{{.*}}}
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-class.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-class.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-class.cpp Thu Aug 29 13:51:51 2013
> @@ -96,33 +96,32 @@ int main(int argc, char **argv) {
>  // CHECK: DW_TAG_class_type ] [B]
>  // CHECK: metadata !"_vptr$B", {{.*}}, i32 64, metadata !{{.*}}} ; [ DW_TAG_member ]
>
> -// CHECK: [[C:![0-9]*]] = {{.*}} metadata [[C_MEM:![0-9]*]], i32 0, metadata [[C]], null, null} ; [ DW_TAG_structure_type ] [C] {{.*}} [def]
> +// CHECK: [[C:![0-9]*]] = {{.*}} metadata [[C_MEM:![0-9]*]], i32 0, metadata [[C]], null, metadata !"_ZTS1C"} ; [ DW_TAG_structure_type ] [C] {{.*}} [def]
>  // CHECK: [[C_MEM]] = metadata !{metadata [[C_VPTR:![0-9]*]], metadata [[C_S:![0-9]*]], metadata [[C_DTOR:![0-9]*]]}
>  // CHECK: [[C_VPTR]] = {{.*}} ; [ DW_TAG_member ] [_vptr$C] {{.*}} [artificial]
>  // CHECK: [[C_S]] = {{.*}} ; [ DW_TAG_member ] [s] {{.*}} [static] [from int]
>  // CHECK: [[C_DTOR]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [~C]
>
> -// CHECK: ; [ DW_TAG_structure_type ] [A]
> -// CHECK: HdrSize
> -// CHECK: metadata [[D_MEM:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_structure_type ] [D] {{.*}} [decl]
> +// CHECK: ; [ DW_TAG_structure_type ] [I] {{.*}} [def]
> +// CHECK: metadata [[D_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTS1D"} ; [ DW_TAG_structure_type ] [D] {{.*}} [decl]
>  // CHECK: [[D_MEM]] = metadata !{metadata [[D_FUNC:![0-9]*]]}
>  // CHECK: [[D_FUNC]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [func]
> -
> -// CHECK: ; [ DW_TAG_structure_type ] [I] {{.*}} [def]
> -
> -// CHECK: [[F_I_DEF:![0-9]*]] = {{.*}}, metadata [[F_I:![0-9]*]]} ; [ DW_TAG_variable ] [i]
> +// CHECK: null, i32 0, null, null, metadata !"_ZTS1E"} ; [ DW_TAG_structure_type ] [E] {{.*}} [decl]
> +// CHECK: [[F:![0-9]*]] = {{.*}} metadata [[F_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTS1F"} ; [ DW_TAG_structure_type ] [F] {{.*}} [def]
> +// CHECK: [[F_MEM]] = metadata !{metadata [[F_I:![0-9]*]]}
>  // CHECK: [[F_I]] = {{.*}} ; [ DW_TAG_member ] [i]
> -// CHECK: [[F:![0-9]*]] = {{.*}} metadata [[F_MEM:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_structure_type ] [F] {{.*}} [def]
> -// CHECK: [[F_MEM]] = metadata !{metadata [[F_I]]}
>
> -// CHECK: null, i32 0, null, null, null} ; [ DW_TAG_structure_type ] [E] {{.*}} [decl]
> -
> -// CHECK: metadata [[G_INNER_MEM:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_structure_type ] [inner] [line 50, {{.*}} [def]
>  // Context chains (in Clang -flimit-debug-info and in GCC generally) contain
>  // definitions without members (& without a vbase 'containing type'):
> -// CHECK: null, i32 0, null, null, null} ; [ DW_TAG_structure_type ] [G] {{.*}} [def]
> +// CHECK: null, i32 0, null, null, metadata !"_ZTS1G"} ; [ DW_TAG_structure_type ] [G] {{.*}} [def]
> +// CHECK: metadata [[G_INNER_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTSN1G5innerE"} ; [ DW_TAG_structure_type ] [inner] [line 50, {{.*}} [def]
>  // CHECK: [[G_INNER_MEM]] = metadata !{metadata [[G_INNER_I:![0-9]*]]}
>  // CHECK: [[G_INNER_I]] = {{.*}} ; [ DW_TAG_member ] [j] {{.*}} [from int]
>
> +// CHECK: ; [ DW_TAG_structure_type ] [A]
> +// CHECK: HdrSize
> +
> +// CHECK: [[F_I_DEF:![0-9]*]] = {{.*}}, metadata [[F_I]]} ; [ DW_TAG_variable ] [i]
> +
>  // CHECK: ![[EXCEPTLOC]] = metadata !{i32 84,
>  // CHECK: ![[RETLOC]] = metadata !{i32 83,
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-decl-nested.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-decl-nested.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-decl-nested.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-decl-nested.cpp Thu Aug 29 13:51:51 2013
> @@ -35,11 +35,11 @@ class OuterClass1
>    public:
>      InnerClass1();
>    } theInnerClass1;
> -// CHECK1: metadata {{.*}}, metadata ![[DECL:[0-9]+]], metadata {{.*}}, i32 [[@LINE+5]]} ; [ DW_TAG_subprogram ] [line [[@LINE+5]]] [def] [Bar]
> +// CHECK1: [[DECL:[0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+2]]] [private] [Bar]
> +// CHECK1: metadata {{.*}}, metadata ![[DECL]], metadata {{.*}}, i32 [[@LINE+4]]} ; [ DW_TAG_subprogram ] [line [[@LINE+4]]] [def] [Bar]
>    void Bar(const Foo1 *);
>  };
>  OuterClass1::InnerClass1 OuterClass1::theInnerClass1;
> -// CHECK1: [[DECL]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE-3]]] [private] [Bar]
>  void OuterClass1::Bar(const Foo1 *meta) { }
>
>
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-enum.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-enum.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-enum.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-enum.cpp Thu Aug 29 13:51:51 2013
> @@ -4,7 +4,7 @@
>  // CHECK: [[ENUMS]] = metadata !{metadata [[E1:![0-9]*]], metadata [[E2:![0-9]*]], metadata [[E3:![0-9]*]]}
>
>  namespace test1 {
> -// CHECK: [[E1]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST1:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS:![0-9]*]], {{[^,]*}}, null, null, null} ; [ DW_TAG_enumeration_type ] [e]
> +// CHECK: [[E1]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST1:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS:![0-9]*]], {{[^,]*}}, null, null, metadata !"_ZTSN5test11eE"} ; [ DW_TAG_enumeration_type ] [e]
>  // CHECK: [[TEST1]] = {{.*}} ; [ DW_TAG_namespace ] [test1]
>  // CHECK: [[TEST1_ENUMS]] = metadata !{metadata [[TEST1_E:![0-9]*]]}
>  // CHECK: [[TEST1_E]] = {{.*}}, metadata !"E", i64 0} ; [ DW_TAG_enumerator ] [E :: 0]
> @@ -16,7 +16,7 @@ void foo() {
>
>  namespace test2 {
>  // rdar://8195980
> -// CHECK: [[E2]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST2:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS]], {{[^,]*}}, null, null, null} ; [ DW_TAG_enumeration_type ] [e]
> +// CHECK: [[E2]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST2:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS]], {{[^,]*}}, null, null, metadata !"_ZTSN5test21eE"} ; [ DW_TAG_enumeration_type ] [e]
>  // CHECK: [[TEST2]] = {{.*}} ; [ DW_TAG_namespace ] [test2]
>  enum e { E };
>  bool func(int i) {
> @@ -25,7 +25,7 @@ bool func(int i) {
>  }
>
>  namespace test3 {
> -// CHECK: [[E3]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST3:![0-9]*]], {{.*}}, metadata [[TEST3_ENUMS:![0-9]*]], {{[^,]*}}, null, null, null} ; [ DW_TAG_enumeration_type ] [e]
> +// CHECK: [[E3]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST3:![0-9]*]], {{.*}}, metadata [[TEST3_ENUMS:![0-9]*]], {{[^,]*}}, null, null, metadata !"_ZTSN5test31eE"} ; [ DW_TAG_enumeration_type ] [e]
>  // CHECK: [[TEST3]] = {{.*}} ; [ DW_TAG_namespace ] [test3]
>  // CHECK: [[TEST3_ENUMS]] = metadata !{metadata [[TEST3_E:![0-9]*]]}
>  // CHECK: [[TEST3_E]] = {{.*}}, metadata !"E", i64 -1} ; [ DW_TAG_enumerator ] [E :: -1]
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-method.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-method.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-method.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-method.cpp Thu Aug 29 13:51:51 2013
> @@ -1,6 +1,7 @@
>  // RUN: %clang_cc1 -emit-llvm -std=c++11 -g %s -o - | FileCheck %s
> -// CHECK: ![[THISTYPE:[0-9]+]] = {{.*}} ; [ DW_TAG_pointer_type ] {{.*}} [artificial] [from A]
> +// CHECK: metadata !"_ZTS1A"} ; [ DW_TAG_class_type ] [A]
>  // CHECK: metadata !"_ZN1A3fooEiS_3$_0", {{.*}} [protected]
> +// CHECK: ![[THISTYPE:[0-9]+]] = {{.*}} ; [ DW_TAG_pointer_type ] {{.*}} [artificial] [from A]
>  // CHECK: DW_TAG_ptr_to_member_type
>  // CHECK: {{.*}}metadata ![[MEMFUNTYPE:[0-9]+]], metadata !{{.*}}} ; [ DW_TAG_ptr_to_member_type ] {{.*}} [from ]
>  // CHECK: ![[MEMFUNTYPE]] = {{.*}}metadata ![[MEMFUNARGS:[0-9]+]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] {{.*}} [from ]
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp Thu Aug 29 13:51:51 2013
> @@ -41,9 +41,11 @@ int func(bool b) {
>
>  // CHECK: [[CU:![0-9]*]] = {{.*}}[[MODULES:![0-9]*]], metadata !""} ; [ DW_TAG_compile_unit ]
>  // CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp"
> +// CHECK: [[FOO:![0-9]*]] {{.*}} ; [ DW_TAG_structure_type ] [foo] [line 5, size 0, align 0, offset 0] [decl] [from ]
>  // CHECK: [[FOOCPP:![0-9]*]] = metadata !{metadata !"foo.cpp", {{.*}}
>  // CHECK: [[NS:![0-9]*]] = {{.*}}, metadata [[FILE2:![0-9]*]], metadata [[CTXT:![0-9]*]], {{.*}} ; [ DW_TAG_namespace ] [B] [line 1]
>  // CHECK: [[CTXT]] = {{.*}}, metadata [[FILE]], null, {{.*}} ; [ DW_TAG_namespace ] [A] [line 5]
> +// CHECK: [[BAR:![0-9]*]] {{.*}} ; [ DW_TAG_structure_type ] [bar] [line 6, {{.*}}] [decl] [from ]
>  // CHECK: [[F1:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] [line 4] [def] [f1]
>  // CHECK: [[FUNC:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func]
>  // CHECK: [[FILE2]]} ; [ DW_TAG_file_type ] [{{.*}}foo.cpp]
> @@ -57,9 +59,7 @@ int func(bool b) {
>  // CHECK: [[LEX1]] = metadata !{i32 {{[0-9]*}}, metadata [[FILE2]], metadata [[FUNC]], i32 {{[0-9]*}}, i32 0, i32 {{.*}}} ; [ DW_TAG_lexical_block ]
>  // CHECK: [[M5]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[CTXT]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_module ]
>  // CHECK: [[M6]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[FOO:![0-9]*]], i32 23} ; [ DW_TAG_imported_declaration ]
> -// CHECK: [[FOO]] {{.*}} ; [ DW_TAG_structure_type ] [foo] [line 5, size 0, align 0, offset 0] [decl] [from ]
>  // CHECK: [[M7]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[BAR:![0-9]*]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_declaration ]
> -// CHECK: [[BAR]] {{.*}} ; [ DW_TAG_structure_type ] [bar] [line 6, {{.*}}] [decl] [from ]
>  // CHECK: [[M8]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[F1]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_declaration ]
>  // CHECK: [[M9]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[I]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_declaration ]
>  // CHECK: [[M10]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[BAZ:![0-9]*]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_declaration ]
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp Thu Aug 29 13:51:51 2013
> @@ -33,13 +33,15 @@ int main()
>  // why the definition of "a" comes before the declarations while
>  // "b" and "c" come after.
>
> -// CHECK: metadata !"a", {{.*}} @_ZN1C1aE, metadata ![[DECL_A:[0-9]+]]} ; [ DW_TAG_variable ] [a] {{.*}} [def]
> -// CHECK: ![[DECL_A]] = metadata {{.*}} [ DW_TAG_member ] [a] [line {{.*}}, size 0, align 0, offset 0] [private] [static]
> +// CHECK: metadata !"_ZTS1X"} ; [ DW_TAG_enumeration_type ] [X]
> +// CHECK: metadata !"_ZTS1C"} ; [ DW_TAG_class_type ] [C]
> +// CHECK: ![[DECL_A:[0-9]+]] = metadata {{.*}} [ DW_TAG_member ] [a] [line {{.*}}, size 0, align 0, offset 0] [private] [static]
>  // CHECK: metadata !"const_a", {{.*}}, i1 true} ; [ DW_TAG_member ] [const_a] [line {{.*}}, size 0, align 0, offset 0] [private] [static]
>  // CHECK: ![[DECL_B:[0-9]+]] {{.*}} metadata !"b", {{.*}} [ DW_TAG_member ] [b] [line {{.*}}, size 0, align 0, offset 0] [protected] [static]
>  // CHECK: metadata !"const_b", {{.*}}, float 0x{{.*}}} ; [ DW_TAG_member ] [const_b] [line {{.*}}, size 0, align 0, offset 0] [protected] [static]
>  // CHECK: ![[DECL_C:[0-9]+]] {{.*}} metadata !"c", {{.*}} [ DW_TAG_member ] [c] [line {{.*}}, size 0, align 0, offset 0] [static]
>  // CHECK: metadata !"const_c", {{.*}} [ DW_TAG_member ] [const_c] [line {{.*}}, size 0, align 0, offset 0] [static]
>  // CHECK: metadata !"x_a", {{.*}} [ DW_TAG_member ] [x_a] {{.*}} [static]
> +// CHECK: metadata !"a", {{.*}} @_ZN1C1aE, metadata ![[DECL_A]]} ; [ DW_TAG_variable ] [a] {{.*}} [def]
>  // CHECK: metadata !"b", {{.*}} @_ZN1C1bE, metadata ![[DECL_B]]} ; [ DW_TAG_variable ] [b] {{.*}} [def]
>  // CHECK: metadata !"c", {{.*}} @_ZN1C1cE, metadata ![[DECL_C]]} ; [ DW_TAG_variable ] [c] {{.*}} [def]
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-template-limit.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-template-limit.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-template-limit.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-template-limit.cpp Thu Aug 29 13:51:51 2013
> @@ -1,8 +1,8 @@
>  // RUN: %clang -flimit-debug-info -emit-llvm -g -S %s -o - | FileCheck %s
>
>  // Check that this pointer type is TC<int>
> -// CHECK: ![[LINE:[0-9]+]]} ; [ DW_TAG_pointer_type ]{{.*}}[from TC<int>]
> -// CHECK-NEXT: ![[LINE]] ={{.*}}"TC<int>"
> +// CHECK: ![[LINE:[0-9]+]] = {{.*}}"TC<int>"
> +// CHECK: ![[LINE]]} ; [ DW_TAG_pointer_type ]{{.*}}[from TC<int>]
>
>  template<typename T>
>  class TC {
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp Thu Aug 29 13:51:51 2013
> @@ -16,9 +16,17 @@ inline int add3(int x) {
>    return MyClass().add<3>(x); // even though add<3> is ODR used, don't emit it since we don't codegen it
>  }
>
> -// CHECK: [[C:![0-9]*]] = {{.*}}, metadata [[C_MEM:![0-9]*]], i32 0, metadata [[C]], null, null} ; [ DW_TAG_structure_type ] [MyClass]
> +// CHECK: [[FOO_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTS3foo"} ; [ DW_TAG_structure_type ] [foo]
> +// CHECK: [[FOO_MEM]] = metadata !{metadata [[FOO_FUNC:![0-9]*]]}
> +// CHECK: [[FOO_FUNC]] = {{.*}}, metadata !"_ZN3foo4funcEN5outerIS_E5innerE", i32 {{[0-9]*}}, metadata [[FOO_FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [func]
> +// CHECK: [[FOO_FUNC_TYPE]] = {{.*}}, metadata [[FOO_FUNC_PARAMS:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
> +// CHECK: [[FOO_FUNC_PARAMS]] = metadata !{null, metadata !{{[0-9]*}}, metadata [[OUTER_FOO_INNER:![0-9]*]]}
> +// CHECK: [[OUTER_FOO_INNER]] = {{.*}} ; [ DW_TAG_structure_type ] [inner]
> +
> +// CHECK: [[C:![0-9]*]] = {{.*}}, metadata [[C_MEM:![0-9]*]], i32 0, metadata [[C]], null, metadata !"_ZTS7MyClass"} ; [ DW_TAG_structure_type ] [MyClass]
>  // CHECK: [[C_MEM]] = metadata !{metadata [[C_VPTR:![0-9]*]], metadata [[C_ADD:![0-9]*]], metadata [[C_FUNC:![0-9]*]], metadata [[C_CTOR:![0-9]*]]}
>  // CHECK: [[C_VPTR]] = {{.*}} ; [ DW_TAG_member ] [_vptr$MyClass]
> +
>  // CHECK: [[C_ADD]] = {{.*}} ; [ DW_TAG_subprogram ] [line 4] [add<2>]
>  // CHECK: [[C_FUNC]] = {{.*}} ; [ DW_TAG_subprogram ] [line 7] [func]
>  // CHECK: [[C_CTOR]] = {{.*}} ; [ DW_TAG_subprogram ] [line 0] [MyClass]
> @@ -43,10 +51,4 @@ inline void func() {
>
>  outer<foo>::inner x;
>
> -// CHECK: metadata [[OUTER_FOO_INNER:![0-9]*]], i32 {{[0-9]*}}, i32 {{[0-9]*}}, %"struct.outer<foo>::inner"* @x, {{.*}} ; [ DW_TAG_variable ] [x]
> -// CHECK: [[OUTER_FOO_INNER]] = {{.*}} ; [ DW_TAG_structure_type ] [inner]
> -// CHECK: [[FOO_MEM:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_structure_type ] [foo]
> -// CHECK: [[FOO_MEM]] = metadata !{metadata [[FOO_FUNC:![0-9]*]]}
> -// CHECK: [[FOO_FUNC]] = {{.*}}, metadata !"_ZN3foo4funcEN5outerIS_E5innerE", i32 {{[0-9]*}}, metadata [[FOO_FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [func]
> -// CHECK: [[FOO_FUNC_TYPE]] = {{.*}}, metadata [[FOO_FUNC_PARAMS:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
> -// CHECK: [[FOO_FUNC_PARAMS]] = metadata !{null, metadata !{{[0-9]*}}, metadata [[OUTER_FOO_INNER]]}
> +// CHECK: metadata [[OUTER_FOO_INNER]], i32 {{[0-9]*}}, i32 {{[0-9]*}}, %"struct.outer<foo>::inner"* @x, {{.*}} ; [ DW_TAG_variable ] [x]
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-template-quals.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-template-quals.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-template-quals.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-template-quals.cpp Thu Aug 29 13:51:51 2013
> @@ -15,13 +15,13 @@ void foo (const char *c) {
>    str.assign(c, str);
>  }
>
> -// CHECK: [[P:.*]] = {{.*}}, metadata [[CON:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
> +// CHECK: [[BS:.*]] = {{.*}} ; [ DW_TAG_structure_type ] [basic_string<char>] [line 4, size 8, align 8, offset 0] [def] [from ]
> +// CHECK: [[TYPE:![0-9]*]] = metadata !{i32 {{.*}}, metadata [[ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
> +// CHECK: [[ARGS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata [[P:![0-9]*]], metadata [[R:.*]]}
> +// CHECK: [[P]] = {{.*}}, metadata [[CON:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
>  // CHECK: [[CON]] = {{.*}}, metadata [[CH:![0-9]*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from char]
>  // CHECK: [[CH]] = {{.*}} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
>
> -// CHECK: {{.*}} metadata [[TYPE:![0-9]*]], {{.*}}, metadata !{{[0-9]*}}, metadata !{{[0-9]*}}, i32 8} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 8] [assign]
> -// CHECK: [[TYPE]] = metadata !{i32 {{.*}}, metadata [[ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
> -// CHECK: [[ARGS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata [[P]], metadata [[R:.*]]}
> -// CHECK: [[BS:.*]] = {{.*}} ; [ DW_TAG_structure_type ] [basic_string<char>] [line 4, size 8, align 8, offset 0] [def] [from ]
>  // CHECK: [[R]] = {{.*}}, metadata [[CON2:![0-9]*]]} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from ]
>  // CHECK: [[CON2]] = {{.*}}, metadata [[BS]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from basic_string<char>]
> +// CHECK: {{.*}} metadata [[TYPE]], {{.*}}, metadata !{{[0-9]*}}, metadata !{{[0-9]*}}, i32 8} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 8] [assign]
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-template.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-template.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-template.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-template.cpp Thu Aug 29 13:51:51 2013
> @@ -3,10 +3,7 @@
>  // CHECK: [[EMPTY:![0-9]*]] = metadata !{i32 0}
>
>
> -// CHECK: [[INT:![0-9]*]] = {{.*}} ; [ DW_TAG_base_type ] [int]
> -// CHECK: metadata [[TCNESTED:![0-9]*]], i32 0, i32 1, %"struct.TC<unsigned int, 2, &glb, &foo::e, &foo::f, &func, tmpl_impl, 1, 2, 3>::nested"* @tci, null} ; [ DW_TAG_variable ] [tci]
> -// CHECK: [[TCNESTED]] = metadata !{i32 {{[0-9]*}}, metadata !{{[0-9]*}}, metadata [[TC:![0-9]*]], {{.*}} ; [ DW_TAG_structure_type ] [nested]
> -// CHECK: [[TC]] = {{.*}}, metadata [[TCARGS:![0-9]*]], null} ; [ DW_TAG_structure_type ] [TC<unsigned int, 2, &glb, &foo::e, &foo::f, &func, tmpl_impl, 1, 2, 3>]
> +// CHECK: [[TC:![0-9]*]] = {{.*}}, metadata [[TCARGS:![0-9]*]], metadata !"{{.*}}"} ; [ DW_TAG_structure_type ] [TC<unsigned int, 2, &glb, &foo::e, &foo::f, &func, tmpl_impl, 1, 2, 3>]
>  // CHECK: [[TCARGS]] = metadata !{metadata [[TCARG1:![0-9]*]], metadata [[TCARG2:![0-9]*]], metadata [[TCARG3:![0-9]*]], metadata [[TCARG4:![0-9]*]], metadata [[TCARG5:![0-9]*]], metadata [[TCARG6:![0-9]*]], metadata [[TCARG7:![0-9]*]], metadata [[TCARG8:![0-9]*]]}
>  //
>  // We seem to be missing file/line/col info on template value parameters -
> @@ -15,9 +12,10 @@
>  //
>  // CHECK: [[TCARG1]] = {{.*}}metadata !"T", metadata [[UINT:![0-9]*]], {{.*}} ; [ DW_TAG_template_type_parameter ]
>  // CHECK: [[UINT:![0-9]*]] = {{.*}} ; [ DW_TAG_base_type ] [unsigned int]
> -// CHECK: [[TCARG2]] = {{.*}}metadata !"", metadata [[UINT:![0-9]*]], i32 2, {{.*}} ; [ DW_TAG_template_value_parameter ]
> +// CHECK: [[TCARG2]] = {{.*}}metadata !"", metadata [[UINT]], i32 2, {{.*}} ; [ DW_TAG_template_value_parameter ]
>  // CHECK: [[TCARG3]] = {{.*}}metadata !"x", metadata [[INTPTR:![0-9]*]], i32* @glb, {{.*}} ; [ DW_TAG_template_value_parameter ]
> -// CHECK: [[INTPTR]] = {{.*}}, metadata [[INT]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from int]
> +// CHECK: [[INTPTR]] = {{.*}}, metadata [[INT:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from int]
> +// CHECK: [[INT]] = {{.*}} ; [ DW_TAG_base_type ] [int]
>  // CHECK: [[TCARG4]] = {{.*}}metadata !"a", metadata [[MEMINTPTR:![0-9]*]], i64 8, {{.*}} ; [ DW_TAG_template_value_parameter ]
>  // CHECK: [[MEMINTPTR]] = {{.*}}, metadata [[FOO:![0-9]*]]} ; [ DW_TAG_ptr_to_member_type ] {{.*}}[from int]
>  //
> @@ -48,8 +46,8 @@
>  // CHECK: [[TCARG8_3]] = {{.*}}metadata !"", metadata [[INT]], i32 3, {{.*}} ; [ DW_TAG_template_value_parameter ]
>
>
> -// CHECK: metadata [[TCNT:![0-9]*]], i32 0, i32 1, %struct.TC* @tcn, null} ; [ DW_TAG_variable ] [tcn]
> -// CHECK: [[TCNT:![0-9]*]] = {{.*}}, metadata [[TCNARGS:![0-9]*]], null} ; [ DW_TAG_structure_type ] [TC<int, -3, nullptr, nullptr, nullptr, nullptr, tmpl_impl>]
> +// CHECK: [[TCNESTED:![0-9]*]] = metadata !{i32 {{[0-9]*}}, metadata !{{[0-9]*}}, metadata [[TC]], {{.*}} ; [ DW_TAG_structure_type ] [nested]
> +// CHECK: [[TCNT:![0-9]*]] = {{.*}}, metadata [[TCNARGS:![0-9]*]], metadata !"{{.*}}"} ; [ DW_TAG_structure_type ] [TC<int, -3, nullptr, nullptr, nullptr, nullptr, tmpl_impl>]
>  // CHECK: [[TCNARGS]] = metadata !{metadata [[TCNARG1:![0-9]*]], metadata [[TCNARG2:![0-9]*]], metadata [[TCNARG3:![0-9]*]], metadata [[TCNARG4:![0-9]*]], metadata [[TCNARG5:![0-9]*]], metadata [[TCNARG6:![0-9]*]], metadata [[TCARG7:![0-9]*]], metadata [[TCNARG8:![0-9]*]]}
>  // CHECK: [[TCNARG1]] = {{.*}}metadata !"T", metadata [[INT]], {{.*}} ; [ DW_TAG_template_type_parameter ]
>  // CHECK: [[TCNARG2]] = {{.*}}metadata !"", metadata [[INT]], i32 -3, {{.*}} ; [ DW_TAG_template_value_parameter ]
> @@ -70,10 +68,14 @@
>  // CHECK: [[TCNARG6]] = {{.*}}metadata !"f", metadata [[FUNPTR]], i8 0, {{.*}} ; [ DW_TAG_template_value_parameter ]
>  // CHECK: [[TCNARG8]] = {{.*}}metadata !"Is", null, metadata [[EMPTY]], {{.*}} ; [ DW_TAG_GNU_template_parameter_pack ]
>
> -// CHECK: metadata [[PTOARGS:![0-9]*]], null} ; [ DW_TAG_structure_type ] [PaddingAtEndTemplate<&PaddedObj>]
> +// CHECK: metadata [[PTOARGS:![0-9]*]], metadata !"{{.*}}"} ; [ DW_TAG_structure_type ] [PaddingAtEndTemplate<&PaddedObj>]
>  // CHECK: [[PTOARGS]] = metadata !{metadata [[PTOARG1:![0-9]*]]}
>  // CHECK: [[PTOARG1]] = {{.*}}metadata !"", metadata [[CONST_PADDINGATEND_PTR:![0-9]*]], { i32, i8, [3 x i8] }* @PaddedObj, {{.*}} ; [ DW_TAG_template_value_parameter ]
>  // CHECK: [[CONST_PADDINGATEND_PTR]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from PaddingAtEnd]
> +
> +// CHECK: metadata [[TCNESTED]], i32 0, i32 1, %"struct.TC<unsigned int, 2, &glb, &foo::e, &foo::f, &func, tmpl_impl, 1, 2, 3>::nested"* @tci, null} ; [ DW_TAG_variable ] [tci]
> +
> +// CHECK: metadata [[TCNT:![0-9]*]], i32 0, i32 1, %struct.TC* @tcn, null} ; [ DW_TAG_variable ] [tcn]
>  struct foo {
>    char pad[8]; // make the member pointer to 'e' a bit more interesting (nonzero)
>    int e;
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-union-template.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-union-template.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-union-template.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-union-template.cpp Thu Aug 29 13:51:51 2013
> @@ -10,6 +10,6 @@ namespace PR15637 {
>    Value<float> f;
>  }
>
> -// CHECK: {{.*}}, metadata !"Value<float>", {{.*}}, null, metadata [[TTPARAM:.*]], null} ; [ DW_TAG_union_type ] [Value<float>]
> +// CHECK: {{.*}}, metadata !"Value<float>", {{.*}}, null, metadata [[TTPARAM:.*]], metadata !"_ZTSN7PR156375ValueIfEE"} ; [ DW_TAG_union_type ] [Value<float>]
>  // CHECK: [[TTPARAM]] = metadata !{metadata [[PARAMS:.*]]}
>  // CHECK: [[PARAMS]] = metadata !{{{.*}}metadata !"T",{{.*}}} ; [ DW_TAG_template_type_parameter ]
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-uuid.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-uuid.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-uuid.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-uuid.cpp Thu Aug 29 13:51:51 2013
> @@ -1,5 +1,5 @@
>  // RUN: %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-pc-win32 -cxx-abi microsoft -g %s -o - -std=c++11 | FileCheck %s
> -// RUN: %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-unknown-unknown -g %s -o - -std=c++11 | FileCheck %s
> +// RUN: not %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-unknown-unknown -g %s -std=c++11 2>&1 | FileCheck %s --check-prefix=CHECK-ITANIUM

Just a heads up - you lost the "-o -" in this change & that broke this
test for systems where the test tree isn't writable. Please ensure the
-o - or -o %t is left in next time you commit this change.

>
>  // CHECK: metadata [[TGIARGS:![0-9]*]], null} ; [ DW_TAG_structure_type ] [tmpl_guid<&__uuidof(uuid)>]
>  // CHECK: [[TGIARGS]] = metadata !{metadata [[TGIARG1:![0-9]*]]}
> @@ -8,6 +8,8 @@
>  // CHECK: [[CONST_GUID]] = {{.*}}, metadata [[GUID:![0-9]*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from _GUID]
>  // CHECK: [[GUID]] = {{.*}} ; [ DW_TAG_structure_type ] [_GUID]
>
> +// CHECK-ITANIUM: error: cannot yet mangle expression type CXXUuidofExpr
> +
>  struct _GUID;
>  template <const _GUID *>
>  struct tmpl_guid {
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info.cpp?rev=189600&r1=189599&r2=189600&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info.cpp Thu Aug 29 13:51:51 2013
> @@ -77,9 +77,15 @@ foo func(foo f) {
>    return f; // reference 'f' for now because otherwise we hit another bug
>  }
>
> +// CHECK: [[FOO:![0-9]*]] = metadata !{i32 {{[0-9]*}}, metadata !{{[0-9]*}}, metadata [[PR14763:![0-9]*]], {{.*}} ; [ DW_TAG_structure_type ] [foo]
> +// CHECK: [[PR14763]] = {{.*}} ; [ DW_TAG_namespace ] [pr14763]
> +// CHECK: [[INCTYPE:![0-9]*]] = {{.*}} ; [ DW_TAG_structure_type ] [incomplete]{{.*}} [decl]
> +// CHECK: metadata [[A_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTSN7pr162141aE"} ; [ DW_TAG_structure_type ] [a]
> +// CHECK: [[A_MEM]] = metadata !{metadata [[A_I:![0-9]*]]}
> +// CHECK: [[A_I]] = {{.*}} ; [ DW_TAG_member ] [i] {{.*}} [from int]
> +// CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}}[decl]
> +
>  // CHECK: [[FUNC:![0-9]*]] = {{.*}} metadata !"_ZN7pr147634funcENS_3fooE", i32 {{[0-9]*}}, metadata [[FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func]
> -// CHECK: [[PR14763:![0-9]*]] = {{.*}} ; [ DW_TAG_namespace ] [pr14763]
> -// CHECK: [[FOO:![0-9]*]] = metadata !{i32 {{[0-9]*}}, metadata !{{[0-9]*}}, metadata [[PR14763]], {{.*}} ; [ DW_TAG_structure_type ] [foo]
>  }
>
>  namespace pr9608 { // also pr9600
> @@ -87,8 +93,7 @@ struct incomplete;
>  incomplete (*x)[3];
>  // CHECK: metadata [[INCARRAYPTR:![0-9]*]], i32 0, i32 1, [3 x i8]** @_ZN6pr96081xE, null} ; [ DW_TAG_variable ] [x]
>  // CHECK: [[INCARRAYPTR]] = {{.*}}metadata [[INCARRAY:![0-9]*]]} ; [ DW_TAG_pointer_type ]
> -// CHECK: [[INCARRAY]] = {{.*}}metadata [[INCTYPE:![0-9]*]], metadata {{![0-9]*}}, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 0, align 0, offset 0] [from incomplete]
> -// CHECK: [[INCTYPE]] = {{.*}} ; [ DW_TAG_structure_type ] [incomplete]{{.*}} [decl]
> +// CHECK: [[INCARRAY]] = {{.*}}metadata [[INCTYPE]], metadata {{![0-9]*}}, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 0, align 0, offset 0] [from incomplete]
>  }
>
>  // For some reason the argument for PR14763 ended up all the way down here
> @@ -112,8 +117,4 @@ void func() {
>    const bt *b_cnst_ptr_inst;
>  }
>
> -// CHECK: metadata [[A_MEM:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_structure_type ] [a]
> -// CHECK: [[A_MEM]] = metadata !{metadata [[A_I:![0-9]*]]}
> -// CHECK: [[A_I]] = {{.*}} ; [ DW_TAG_member ] [i] {{.*}} [from int]
> -// CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}}[decl]
>  }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list