r202334 - Pass down the debug emission kind into the compile unit for code

Adrian Prantl aprantl at apple.com
Fri Feb 28 20:33:02 PST 2014


On Feb 26, 2014, at 5:25 PM, Eric Christopher <echristo at gmail.com> wrote:

> Author: echristo
> Date: Wed Feb 26 19:25:08 2014
> New Revision: 202334
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=202334&view=rev
> Log:
> Pass down the debug emission kind into the compile unit for code
> generation purposes.
> Paired with a commit to llvm.
> 
> Modified:
>    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>    cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=202334&r1=202333&r2=202334&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Feb 26 19:25:08 2014
> @@ -382,10 +382,12 @@ void CGDebugInfo::CreateCompileUnit() {
> 
>   // Create new compile unit.
>   // FIXME - Eliminate TheCU.
> -  TheCU = DBuilder.createCompileUnit(LangTag, Filename, getCurrentDirname(),
> -                                     Producer, LO.Optimize,
> -                                     CGM.getCodeGenOpts().DwarfDebugFlags,
> -                                     RuntimeVers, SplitDwarfFilename);
> +  TheCU = DBuilder.createCompileUnit(
> +      LangTag, Filename, getCurrentDirname(), Producer, LO.Optimize,
> +      CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers, SplitDwarfFilename,
> +      DebugKind == CodeGenOptions::DebugLineTablesOnly
> +          ? llvm::DIBuilder::LineTablesOnly
> +          : llvm::DIBuilder::FullDebug);
> }

DebugKind actually has more than two entries. There is also LimitedDebugInfo. While it is ok to sweep it under the rug, because it is a frontend-only feature, I wonder if we should put in a comment here to explain this?

-- adrian

> 
> /// CreateType - Get the Basic type from the cache or create a new
> 
> 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=202334&r1=202333&r2=202334&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-namespace.cpp Wed Feb 26 19:25:08 2014
> @@ -43,7 +43,7 @@ using B::i;
> // This should work even if 'i' and 'func' were declarations & not definitions,
> // but it doesn't yet.
> 
> -// CHECK: [[CU:![0-9]*]] = {{.*}}[[MODULES:![0-9]*]], metadata !""} ; [ DW_TAG_compile_unit ]
> +// CHECK: [[CU:![0-9]*]] = {{.*}}[[MODULES:![0-9]*]], metadata !"", i32 1} ; [ 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", {{.*}}
> @@ -72,7 +72,7 @@ using B::i;
> // CHECK: [[M12]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[M11]], i32 {{[0-9]*}}, metadata !"Y"} ; [ DW_TAG_imported_module ]
> // CHECK: [[M13]] = metadata !{i32 {{[0-9]*}}, metadata [[CTXT]], metadata [[I]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_declaration ]
> 
> -// CHECK-GMLT: [[CU:![0-9]*]] = {{.*}}[[MODULES:![0-9]*]], metadata !""} ; [ DW_TAG_compile_unit ]
> +// CHECK-GMLT: [[CU:![0-9]*]] = {{.*}}[[MODULES:![0-9]*]], metadata !"", i32 2} ; [ DW_TAG_compile_unit ]
> // CHECK-GMLT: [[MODULES]] = metadata !{}
> 
> // CHECK-NOLIMIT: ; [ DW_TAG_structure_type ] [bar] [line 6, {{.*}}] [def] [from ]
> 
> 
> _______________________________________________
> 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