[PATCH] D18612: Move the DebugEmissionKind enum from DIBuilder into DICompileUnit and add a Verifier check for it.

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 11:44:17 PDT 2016


aprantl created this revision.
aprantl added reviewers: dexonsmith, dblaikie, echristo.
aprantl added a subscriber: llvm-commits.
Herald added subscribers: dsanders, jyknight.

This mostly cosmetic patch moves the DebugEmissionKind enum from DIBuilder into DICompileUnit.
DIBuilder is not the right place for this enum to live in — a metadata consumer should not have to include DIBuilder.h.
I also added a Verifier check that checks that the emission kind of a DICompileUnit is actually legal.

Note:
In case anyone is wondering why the Verifier also accepts 0 as a valid emission kind: In a subsequent review I will propose a new "NoDebug = 0" emission kind that will prevent the backend from emitting any Dwarf. Sample-based profiling currently deletes the !llvm.dbg.cu node to suppress Dwarf output, but this is not valid IR and I would like to get rid of this hack.

http://reviews.llvm.org/D18612

Files:
  include/llvm/IR/DIBuilder.h
  include/llvm/IR/DebugInfoMetadata.h
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  lib/IR/DIBuilder.cpp
  lib/IR/Verifier.cpp
  test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll
  test/Assembler/dicompileunit.ll
  test/Assembler/drop-debug-info.ll
  test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll
  test/CodeGen/ARM/2009-10-16-Scope.ll
  test/CodeGen/ARM/2010-04-15-ScavengerDebugValue.ll
  test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
  test/CodeGen/ARM/coalesce-dbgvalue.ll
  test/CodeGen/ARM/debug-frame-vararg.ll
  test/CodeGen/ARM/debug-frame.ll
  test/CodeGen/ARM/debug-segmented-stacks.ll
  test/CodeGen/Inputs/DbgValueOtherTargets.ll
  test/CodeGen/MIR/X86/invalid-metadata-node-type.mir
  test/CodeGen/MIR/X86/stack-object-debug-info.mir
  test/CodeGen/PowerPC/dbg.ll
  test/CodeGen/PowerPC/pr17168.ll
  test/CodeGen/PowerPC/unwind-dw2-g.ll
  test/CodeGen/Thumb/2010-07-15-debugOrdering.ll
  test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll
  test/CodeGen/X86/2009-10-16-Scope.ll
  test/CodeGen/X86/2010-01-18-DbgValue.ll
  test/CodeGen/X86/2010-02-01-DbgValueCrash.ll
  test/CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll
  test/CodeGen/X86/2010-07-06-DbgCrash.ll
  test/CodeGen/X86/2010-09-16-EmptyFilename.ll
  test/CodeGen/X86/2010-11-02-DbgParameter.ll
  test/CodeGen/X86/2012-11-30-handlemove-dbg.ll
  test/CodeGen/X86/2012-11-30-misched-dbg.ll
  test/CodeGen/X86/2012-11-30-regpres-dbg.ll
  test/CodeGen/X86/StackColoring-dbg.ll
  test/CodeGen/X86/dwarf-comp-dir.ll
  test/CodeGen/X86/null-streamer.ll
  test/CodeGen/X86/unknown-location.ll
  test/DebugInfo/AArch64/dwarfdump.ll
  test/DebugInfo/AArch64/struct_by_value.ll
  test/DebugInfo/ARM/lowerbdgdeclare_vla.ll
  test/DebugInfo/ARM/tls.ll
  test/DebugInfo/COFF/asm.ll
  test/DebugInfo/COFF/multifile.ll
  test/DebugInfo/COFF/multifunction.ll
  test/DebugInfo/COFF/simple.ll
  test/DebugInfo/Generic/2009-11-03-InsertExtractValue.ll
  test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll
  test/DebugInfo/Generic/2009-11-06-NamelessGlobalVariable.ll
  test/DebugInfo/Generic/2009-11-10-CurrentFn.ll
  test/DebugInfo/Generic/2010-01-05-DbgScope.ll
  test/DebugInfo/Generic/2010-03-12-llc-crash.ll
  test/DebugInfo/Generic/2010-03-24-MemberFn.ll
  test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll
  test/DebugInfo/Generic/2010-04-19-FramePtr.ll
  test/DebugInfo/Generic/2010-05-03-DisableFramePtr.ll
  test/DebugInfo/Generic/2010-05-03-OriginDIE.ll
  test/DebugInfo/Generic/2010-05-10-MultipleCU.ll
  test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll
  test/DebugInfo/Generic/2010-07-19-Crash.ll
  test/DebugInfo/Generic/2010-10-01-crash.ll
  test/DebugInfo/Generic/array.ll
  test/DebugInfo/Generic/bug_null_debuginfo.ll
  test/DebugInfo/Generic/dbg-at-specficiation.ll
  test/DebugInfo/Generic/debug-info-qualifiers.ll
  test/DebugInfo/Generic/debuginfofinder-multiple-cu.ll
  test/DebugInfo/Generic/dwarf-public-names.ll
  test/DebugInfo/Generic/empty.ll
  test/DebugInfo/Generic/enum.ll
  test/DebugInfo/Generic/global.ll
  test/DebugInfo/Generic/inheritance.ll
  test/DebugInfo/Generic/inline-debug-info-multiret.ll
  test/DebugInfo/Generic/inline-debug-info.ll
  test/DebugInfo/Generic/inlined-vars.ll
  test/DebugInfo/Generic/member-order.ll
  test/DebugInfo/Generic/member-pointers.ll
  test/DebugInfo/Generic/ptrsize.ll
  test/DebugInfo/Generic/template-recursive-void.ll
  test/DebugInfo/Generic/tu-composite.ll
  test/DebugInfo/Generic/tu-member-pointer.ll
  test/DebugInfo/Generic/varargs.ll
  test/DebugInfo/Generic/version.ll
  test/DebugInfo/Mips/InlinedFnLocalVar.ll
  test/DebugInfo/PowerPC/tls-fission.ll
  test/DebugInfo/PowerPC/tls.ll
  test/DebugInfo/Sparc/gnu-window-save.ll
  test/DebugInfo/SystemZ/variable-loc.ll
  test/DebugInfo/X86/2010-04-13-PubType.ll
  test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll
  test/DebugInfo/X86/2011-12-16-BadStructRef.ll
  test/DebugInfo/X86/DW_AT_byte_size.ll
  test/DebugInfo/X86/DW_AT_object_pointer.ll
  test/DebugInfo/X86/DW_AT_specification.ll
  test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll
  test/DebugInfo/X86/DW_TAG_friend.ll
  test/DebugInfo/X86/InlinedFnLocalVar.ll
  test/DebugInfo/X86/aligned_stack_var.ll
  test/DebugInfo/X86/arange.ll
  test/DebugInfo/X86/byvalstruct.ll
  test/DebugInfo/X86/c-type-units.ll
  test/DebugInfo/X86/coff_debug_info_type.ll
  test/DebugInfo/X86/coff_relative_names.ll
  test/DebugInfo/X86/concrete_out_of_line.ll
  test/DebugInfo/X86/data_member_location.ll
  test/DebugInfo/X86/dbg-byval-parameter.ll
  test/DebugInfo/X86/dbg-const-int.ll
  test/DebugInfo/X86/dbg-declare.ll
  test/DebugInfo/X86/dbg-file-name.ll
  test/DebugInfo/X86/dbg-i128-const.ll
  test/DebugInfo/X86/dbg-merge-loc-entry.ll
  test/DebugInfo/X86/dbg-prolog-end.ll
  test/DebugInfo/X86/dbg-subrange.ll
  test/DebugInfo/X86/dbg-value-location.ll
  test/DebugInfo/X86/debug-info-block-captured-self.ll
  test/DebugInfo/X86/debug-info-static-member.ll
  test/DebugInfo/X86/debug_frame.ll
  test/DebugInfo/X86/discriminator.ll
  test/DebugInfo/X86/dwarf-aranges.ll
  test/DebugInfo/X86/dwarf-public-names.ll
  test/DebugInfo/X86/dwarf-pubnames-split.ll
  test/DebugInfo/X86/earlydup-crash.ll
  test/DebugInfo/X86/elf-names.ll
  test/DebugInfo/X86/empty-and-one-elem-array.ll
  test/DebugInfo/X86/empty-array.ll
  test/DebugInfo/X86/empty.ll
  test/DebugInfo/X86/ending-run.ll
  test/DebugInfo/X86/enum-class.ll
  test/DebugInfo/X86/enum-fwd-decl.ll
  test/DebugInfo/X86/fission-cu.ll
  test/DebugInfo/X86/fission-hash.ll
  test/DebugInfo/X86/fission-ranges.ll
  test/DebugInfo/X86/generate-odr-hash.ll
  test/DebugInfo/X86/gnu-public-names-empty.ll
  test/DebugInfo/X86/line-info.ll
  test/DebugInfo/X86/linkage-name.ll
  test/DebugInfo/X86/multiple-aranges.ll
  test/DebugInfo/X86/multiple-at-const-val.ll
  test/DebugInfo/X86/nondefault-subrange-array.ll
  test/DebugInfo/X86/objc-fwd-decl.ll
  test/DebugInfo/X86/objc-property-void.ll
  test/DebugInfo/X86/pointer-type-size.ll
  test/DebugInfo/X86/pr11300.ll
  test/DebugInfo/X86/pr12831.ll
  test/DebugInfo/X86/pr13303.ll
  test/DebugInfo/X86/prologue-stack.ll
  test/DebugInfo/X86/ref_addr_relocation.ll
  test/DebugInfo/X86/reference-argument.ll
  test/DebugInfo/X86/rvalue-ref.ll
  test/DebugInfo/X86/stmt-list.ll
  test/DebugInfo/X86/stringpool.ll
  test/DebugInfo/X86/struct-loc.ll
  test/DebugInfo/X86/subrange-type.ll
  test/DebugInfo/X86/tls.ll
  test/DebugInfo/X86/union-template.ll
  test/DebugInfo/X86/vector.ll
  test/Instrumentation/AddressSanitizer/debug_info.ll
  test/Linker/2009-09-03-mdnode.ll
  test/Linker/2009-09-03-mdnode2.ll
  test/Linker/2011-08-04-DebugLoc.ll
  test/Linker/2011-08-04-DebugLoc2.ll
  test/Linker/2011-08-04-Metadata.ll
  test/Linker/2011-08-04-Metadata2.ll
  test/Linker/2011-08-18-unique-class-type.ll
  test/Linker/2011-08-18-unique-class-type2.ll
  test/Linker/2011-08-18-unique-debug-type.ll
  test/Linker/2011-08-18-unique-debug-type2.ll
  test/Linker/DbgDeclare.ll
  test/Linker/DbgDeclare2.ll
  test/Linker/Inputs/type-unique-inheritance-a.ll
  test/Linker/Inputs/type-unique-inheritance-b.ll
  test/Linker/Inputs/type-unique-simple2-a.ll
  test/Linker/Inputs/type-unique-simple2-b.ll
  test/Linker/debug-info-version-a.ll
  test/Linker/type-unique-simple-a.ll
  test/Linker/type-unique-simple-b.ll
  test/Linker/type-unique-simple2-a.ll
  test/Linker/type-unique-simple2-b.ll
  test/Transforms/AddDiscriminators/basic.ll
  test/Transforms/AddDiscriminators/first-only.ll
  test/Transforms/AddDiscriminators/multiple.ll
  test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
  test/Transforms/DeadStoreElimination/inst-limits.ll
  test/Transforms/GCOVProfiling/linkagename.ll
  test/Transforms/GCOVProfiling/version.ll
  test/Transforms/GlobalOpt/2009-03-05-dbg.ll
  test/Transforms/Inline/ignore-debug-info.ll
  test/Transforms/InstCombine/debug-line.ll
  test/Transforms/InstCombine/debuginfo.ll
  test/Transforms/LICM/debug-value.ll
  test/Transforms/LoopIdiom/debug-line.ll
  test/Transforms/LoopRotate/dbgvalue.ll
  test/Transforms/LoopVectorize/dbg.value.ll
  test/Transforms/LoopVectorize/debugloc.ll
  test/Transforms/Mem2Reg/ConvertDebugInfo.ll
  test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
  test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
  test/Transforms/SLPVectorizer/X86/debug_info.ll
  test/Transforms/SampleProfile/calls.ll
  test/Transforms/SampleProfile/discriminator.ll
  test/Transforms/SampleProfile/inline.ll
  test/Transforms/SampleProfile/propagate.ll
  test/Transforms/ScalarRepl/debuginfo-preserved.ll
  test/Transforms/Scalarizer/dbginfo.ll
  test/Transforms/SimplifyCFG/branch-fold-dbg.ll
  test/Transforms/SimplifyCFG/hoist-dbgvalue.ll
  test/Transforms/SimplifyCFG/trap-debugloc.ll
  test/Transforms/StripSymbols/2010-06-30-StripDebug.ll
  test/Verifier/func-dbg.ll
  test/Verifier/invalid-dicompileunit-emissionkind-bad.ll
  unittests/IR/MetadataTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18612.52093.patch
Type: text/x-patch
Size: 203527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160330/c9757769/attachment-0001.bin>


More information about the llvm-commits mailing list