r189530 - DebugInfo: Further fix/improvements to r189494 (and LLVM r189495).

Eric Christopher echristo at gmail.com
Wed Aug 28 16:12:18 PDT 2013


80-col here:

> +    } else if (const FunctionTemplateDecl *FTD = dyn_cast<FunctionTemplateDecl>(*I)) {
> +      // Add any template specializations that have already been seen. Like
> +      // implicit member functions, these may have been added to a declaration
> +      // in the case of vtable-based debug info reduction.

and here:

> +      for (FunctionTemplateDecl::spec_iterator SI = FTD->spec_begin(), SE = FTD->spec_end(); SI != SE; ++SI) {

:)

-eric


> +        llvm::DenseMap<const FunctionDecl *, llvm::WeakVH>::iterator MI =
> +            SPCache.find(cast<CXXMethodDecl>(*SI)->getCanonicalDecl());
> +        if (MI != SPCache.end())
> +          EltTys.push_back(MI->second);
> +      }
>      }
>    }
>  }
>
> 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=189530&r1=189529&r2=189530&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp Wed Aug 28 18:06:52 2013
> @@ -4,6 +4,8 @@ struct MyClass {
>    template <int i> int add(int j) {
>      return i + j;
>    }
> +  virtual void func() {
> +  }
>  };
>
>  int add2(int x) {
> @@ -14,9 +16,12 @@ 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: metadata [[C_MEM:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_structure_type ] [MyClass]
> -// CHECK: [[C_MEM]] = metadata !{metadata [[C_TEMP:![0-9]*]]}
> -// CHECK: [[C_TEMP]] = {{.*}} ; [ DW_TAG_subprogram ] [line 4] [add<2>]
> +// CHECK: [[C:![0-9]*]] = {{.*}}, metadata [[C_MEM:![0-9]*]], i32 0, metadata [[C]], null, null} ; [ 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]
>
>  template<typename T>
>  struct outer {
>
>
> _______________________________________________
> 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