DebugInfo: Move new hierarchy into place
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 3 Mar 2015 17:24:31 +0000 (17:24 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 3 Mar 2015 17:24:31 +0000 (17:24 +0000)
commitb056aa798d14792e5d5b03710c6983dd465eb519
treea915abde91fd7415a35768c71c384d0181e33dad
parent853cd2630e8a2d2d40197702a6d31fb9d6fda274
DebugInfo: Move new hierarchy into place

Move the specialized metadata nodes for the new debug info hierarchy
into place, finishing off PR22464.  I've done bootstraps (and all that)
and I'm confident this commit is NFC as far as DWARF output is
concerned.  Let me know if I'm wrong :).

The code changes are fairly mechanical:

  - Bumped the "Debug Info Version".
  - `DIBuilder` now creates the appropriate subclass of `MDNode`.
  - Subclasses of DIDescriptor now expect to hold their "MD"
    counterparts (e.g., `DIBasicType` expects `MDBasicType`).
  - Deleted a ton of dead code in `AsmWriter.cpp` and `DebugInfo.cpp`
    for printing comments.
  - Big update to LangRef to describe the nodes in the new hierarchy.
    Feel free to make it better.

Testcase changes are enormous.  There's an accompanying clang commit on
its way.

If you have out-of-tree debug info testcases, I just broke your build.

  - `upgrade-specialized-nodes.sh` is attached to PR22564.  I used it to
    update all the IR testcases.
  - Unfortunately I failed to find way to script the updates to CHECK
    lines, so I updated all of these by hand.  This was fairly painful,
    since the old CHECKs are difficult to reason about.  That's one of
    the benefits of the new hierarchy.

This work isn't quite finished, BTW.  The `DIDescriptor` subclasses are
almost empty wrappers, but not quite: they still have loose casting
checks (see the `RETURN_FROM_RAW()` macro).  Once they're completely
gutted, I'll rename the "MD" classes to "DI" and kill the wrappers.  I
also expect to make a few schema changes now that it's easier to reason
about everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231082 91177308-0d34-0410-b5e6-96231b3b80d8
380 files changed:
docs/LangRef.rst
include/llvm/IR/DebugInfo.h
include/llvm/IR/Metadata.h
lib/Analysis/ModuleDebugInfoPrinter.cpp
lib/IR/AsmWriter.cpp
lib/IR/DIBuilder.cpp
lib/IR/DebugInfo.cpp
test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll
test/Assembler/drop-debug-info.ll
test/Assembler/functionlocal-metadata.ll
test/Bindings/OCaml/core.ml
test/BugPoint/metadata.ll
test/CodeGen/AArch64/aarch64-2014-08-11-MachineCombinerCrash.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/2010-06-25-Thumb2ITInvalidIterator.ll
test/CodeGen/ARM/2010-08-04-StackVariable.ll
test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
test/CodeGen/ARM/2011-08-02-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-info-arg.ll
test/CodeGen/ARM/debug-info-blocks.ll
test/CodeGen/ARM/debug-info-branch-folding.ll
test/CodeGen/ARM/debug-info-d16-reg.ll
test/CodeGen/ARM/debug-info-qreg.ll
test/CodeGen/ARM/debug-info-s16-reg.ll
test/CodeGen/ARM/debug-info-sreg2.ll
test/CodeGen/ARM/debug-segmented-stacks.ll
test/CodeGen/ARM/vfp-regs-dwarf.ll
test/CodeGen/Generic/dbg_value.ll
test/CodeGen/Hexagon/hwloop-dbg.ll
test/CodeGen/Inputs/DbgValueOtherTargets.ll
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-05-25-DotDebugLoc.ll
test/CodeGen/X86/2010-05-26-DotDebugLoc.ll
test/CodeGen/X86/2010-05-28-Crash.ll
test/CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll
test/CodeGen/X86/2010-07-06-DbgCrash.ll
test/CodeGen/X86/2010-08-04-StackVariable.ll
test/CodeGen/X86/2010-09-16-EmptyFilename.ll
test/CodeGen/X86/2010-11-02-DbgParameter.ll
test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.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/MachineSink-DbgValue.ll
test/CodeGen/X86/StackColoring-dbg.ll
test/CodeGen/X86/dbg-changes-codegen-branch-folding.ll
test/CodeGen/X86/dbg-changes-codegen.ll
test/CodeGen/X86/dbg-combine.ll
test/CodeGen/X86/dwarf-comp-dir.ll
test/CodeGen/X86/fpstack-debuginstr-kill.ll
test/CodeGen/X86/misched-code-difference-with-debug.ll
test/CodeGen/X86/null-streamer.ll
test/CodeGen/X86/stack-protector-dbginfo.ll
test/CodeGen/X86/unknown-location.ll
test/CodeGen/XCore/dwarf_debug.ll
test/DebugInfo/2009-11-03-InsertExtractValue.ll
test/DebugInfo/2009-11-05-DeadGlobalVariable.ll
test/DebugInfo/2009-11-06-NamelessGlobalVariable.ll
test/DebugInfo/2009-11-10-CurrentFn.ll
test/DebugInfo/2010-01-05-DbgScope.ll
test/DebugInfo/2010-03-12-llc-crash.ll
test/DebugInfo/2010-03-19-DbgDeclare.ll
test/DebugInfo/2010-03-24-MemberFn.ll
test/DebugInfo/2010-03-30-InvalidDbgInfoCrash.ll
test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll
test/DebugInfo/2010-04-19-FramePtr.ll
test/DebugInfo/2010-05-03-DisableFramePtr.ll
test/DebugInfo/2010-05-03-OriginDIE.ll
test/DebugInfo/2010-05-10-MultipleCU.ll
test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll
test/DebugInfo/2010-07-19-Crash.ll
test/DebugInfo/2010-10-01-crash.ll
test/DebugInfo/AArch64/big-endian.ll
test/DebugInfo/AArch64/cfi-eof-prologue.ll
test/DebugInfo/AArch64/coalescing.ll
test/DebugInfo/AArch64/dwarfdump.ll
test/DebugInfo/AArch64/frameindices.ll
test/DebugInfo/AArch64/struct_by_value.ll
test/DebugInfo/ARM/PR16736.ll
test/DebugInfo/ARM/cfi-eof-prologue.ll
test/DebugInfo/ARM/lowerbdgdeclare_vla.ll
test/DebugInfo/ARM/s-super-register.ll
test/DebugInfo/ARM/sectionorder.ll
test/DebugInfo/ARM/selectiondag-deadcode.ll
test/DebugInfo/ARM/tls.ll
test/DebugInfo/COFF/asan-module-ctor.ll
test/DebugInfo/COFF/asan-module-without-functions.ll
test/DebugInfo/COFF/asm.ll
test/DebugInfo/COFF/cpp-mangling.ll
test/DebugInfo/COFF/multifile.ll
test/DebugInfo/COFF/multifunction.ll
test/DebugInfo/COFF/simple.ll
test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll
test/DebugInfo/Inputs/gmlt.ll
test/DebugInfo/Inputs/line.ll
test/DebugInfo/Mips/delay-slot.ll
test/DebugInfo/Mips/fn-call-line.ll
test/DebugInfo/PR20038.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_linkage_name.ll
test/DebugInfo/X86/DW_AT_location-reference.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/aligned_stack_var.ll
test/DebugInfo/X86/arange.ll
test/DebugInfo/X86/arguments.ll
test/DebugInfo/X86/array.ll
test/DebugInfo/X86/array2.ll
test/DebugInfo/X86/block-capture.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/constant-aggregate.ll
test/DebugInfo/X86/cu-ranges-odr.ll
test/DebugInfo/X86/cu-ranges.ll
test/DebugInfo/X86/data_member_location.ll
test/DebugInfo/X86/dbg-at-specficiation.ll
test/DebugInfo/X86/dbg-byval-parameter.ll
test/DebugInfo/X86/dbg-const-int.ll
test/DebugInfo/X86/dbg-const.ll
test/DebugInfo/X86/dbg-declare-arg.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-const-byref.ll
test/DebugInfo/X86/dbg-value-dag-combine.ll
test/DebugInfo/X86/dbg-value-inlined-parameter.ll
test/DebugInfo/X86/dbg-value-isel.ll
test/DebugInfo/X86/dbg-value-location.ll
test/DebugInfo/X86/dbg-value-range.ll
test/DebugInfo/X86/dbg-value-terminator.ll
test/DebugInfo/X86/dbg_value_direct.ll
test/DebugInfo/X86/debug-dead-local-var.ll
test/DebugInfo/X86/debug-info-access.ll
test/DebugInfo/X86/debug-info-block-captured-self.ll
test/DebugInfo/X86/debug-info-blocks.ll
test/DebugInfo/X86/debug-info-static-member.ll
test/DebugInfo/X86/debug-loc-asan.ll
test/DebugInfo/X86/debug-loc-offset.ll
test/DebugInfo/X86/debug-ranges-offset.ll
test/DebugInfo/X86/debug_frame.ll
test/DebugInfo/X86/decl-derived-member.ll
test/DebugInfo/X86/discriminator.ll
test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.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/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-inline.ll
test/DebugInfo/X86/fission-ranges.ll
test/DebugInfo/X86/float_const.ll
test/DebugInfo/X86/formal_parameter.ll
test/DebugInfo/X86/generate-odr-hash.ll
test/DebugInfo/X86/ghost-sdnode-dbgvalues.ll
test/DebugInfo/X86/gnu-public-names-empty.ll
test/DebugInfo/X86/gnu-public-names.ll
test/DebugInfo/X86/inline-member-function.ll
test/DebugInfo/X86/inline-seldag-test.ll
test/DebugInfo/X86/instcombine-instrinsics.ll
test/DebugInfo/X86/lexical_block.ll
test/DebugInfo/X86/line-info.ll
test/DebugInfo/X86/linkage-name.ll
test/DebugInfo/X86/low-pc-cu.ll
test/DebugInfo/X86/memberfnptr.ll
test/DebugInfo/X86/misched-dbg-value.ll
test/DebugInfo/X86/multiple-aranges.ll
test/DebugInfo/X86/multiple-at-const-val.ll
test/DebugInfo/X86/nodebug_with_debug_loc.ll
test/DebugInfo/X86/nondefault-subrange-array.ll
test/DebugInfo/X86/nophysreg.ll
test/DebugInfo/X86/objc-fwd-decl.ll
test/DebugInfo/X86/objc-property-void.ll
test/DebugInfo/X86/op_deref.ll
test/DebugInfo/X86/parameters.ll
test/DebugInfo/X86/pieces-1.ll
test/DebugInfo/X86/pieces-2.ll
test/DebugInfo/X86/pieces-3.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/pr19307.ll
test/DebugInfo/X86/processes-relocations.ll
test/DebugInfo/X86/prologue-stack.ll
test/DebugInfo/X86/recursive_inlining.ll
test/DebugInfo/X86/ref_addr_relocation.ll
test/DebugInfo/X86/reference-argument.ll
test/DebugInfo/X86/rvalue-ref.ll
test/DebugInfo/X86/sret.ll
test/DebugInfo/X86/sroasplit-1.ll
test/DebugInfo/X86/sroasplit-2.ll
test/DebugInfo/X86/sroasplit-3.ll
test/DebugInfo/X86/sroasplit-4.ll
test/DebugInfo/X86/sroasplit-5.ll
test/DebugInfo/X86/stmt-list-multiple-compile-units.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/subreg.ll
test/DebugInfo/X86/subregisters.ll
test/DebugInfo/X86/template.ll
test/DebugInfo/X86/tls.ll
test/DebugInfo/X86/type_units_with_addresses.ll
test/DebugInfo/X86/union-const.ll
test/DebugInfo/X86/union-template.ll
test/DebugInfo/X86/vector.ll
test/DebugInfo/X86/vla.ll
test/DebugInfo/array.ll
test/DebugInfo/block-asan.ll
test/DebugInfo/bug_null_debuginfo.ll
test/DebugInfo/constant-pointers.ll
test/DebugInfo/cross-cu-inlining.ll
test/DebugInfo/cross-cu-linkonce-distinct.ll
test/DebugInfo/cross-cu-linkonce.ll
test/DebugInfo/cu-range-hole.ll
test/DebugInfo/cu-ranges.ll
test/DebugInfo/dead-argument-order.ll
test/DebugInfo/debug-info-qualifiers.ll
test/DebugInfo/debuginfofinder-multiple-cu.ll
test/DebugInfo/dwarf-public-names.ll
test/DebugInfo/empty.ll
test/DebugInfo/enum-types.ll
test/DebugInfo/enum.ll
test/DebugInfo/global.ll
test/DebugInfo/incorrect-variable-debugloc.ll
test/DebugInfo/incorrect-variable-debugloc1.ll
test/DebugInfo/inheritance.ll
test/DebugInfo/inline-debug-info-multiret.ll
test/DebugInfo/inline-debug-info.ll
test/DebugInfo/inline-no-debug-info.ll
test/DebugInfo/inline-scopes.ll
test/DebugInfo/inlined-arguments.ll
test/DebugInfo/inlined-vars.ll
test/DebugInfo/location-verifier.ll
test/DebugInfo/lto-comp-dir.ll
test/DebugInfo/member-order.ll
test/DebugInfo/member-pointers.ll
test/DebugInfo/missing-abstract-variable.ll
test/DebugInfo/multiline.ll
test/DebugInfo/namespace.ll
test/DebugInfo/namespace_function_definition.ll
test/DebugInfo/namespace_inline_function_definition.ll
test/DebugInfo/nodebug.ll
test/DebugInfo/piece-verifier.ll
test/DebugInfo/restrict.ll
test/DebugInfo/sugared-constants.ll
test/DebugInfo/template-recursive-void.ll
test/DebugInfo/tu-composite.ll
test/DebugInfo/tu-member-pointer.ll
test/DebugInfo/two-cus-from-same-file.ll
test/DebugInfo/typedef.ll
test/DebugInfo/unconditional-branch.ll
test/DebugInfo/varargs.ll
test/DebugInfo/version.ll
test/Feature/md_on_instruction.ll
test/Instrumentation/AddressSanitizer/debug_info.ll
test/Instrumentation/DataFlowSanitizer/debug.ll
test/Instrumentation/MemorySanitizer/store-origin.ll
test/Instrumentation/SanitizerCoverage/coverage-dbg.ll
test/Instrumentation/SanitizerCoverage/coverage2-dbg.ll
test/JitListener/multiple.ll
test/JitListener/simple.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/replaced-function-matches-first-subprogram.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/debug-info-version-b.ll
test/Linker/replaced-function-matches-first-subprogram.ll
test/Linker/type-unique-odr-a.ll
test/Linker/type-unique-odr-b.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/Linker/type-unique-type-array-a.ll
test/Linker/type-unique-type-array-b.ll
test/MC/ARM/coff-debugging-secrel.ll
test/MC/ELF/cfi-version.ll
test/MC/X86/i386-darwin-frame-register.ll
test/Transforms/AddDiscriminators/basic.ll
test/Transforms/AddDiscriminators/first-only.ll
test/Transforms/AddDiscriminators/multiple.ll
test/Transforms/AddDiscriminators/no-discriminators.ll
test/Transforms/ArgumentPromotion/dbg.ll
test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
test/Transforms/DeadArgElim/dbginfo.ll
test/Transforms/DeadStoreElimination/inst-limits.ll
test/Transforms/GCOVProfiling/function-numbering.ll
test/Transforms/GCOVProfiling/global-ctor.ll
test/Transforms/GCOVProfiling/linezero.ll
test/Transforms/GCOVProfiling/linkagename.ll
test/Transforms/GCOVProfiling/return-block.ll
test/Transforms/GCOVProfiling/version.ll
test/Transforms/GlobalOpt/2009-03-05-dbg.ll
test/Transforms/Inline/alloca-dbgdeclare.ll
test/Transforms/Inline/debug-info-duplicate-calls.ll
test/Transforms/Inline/debug-invoke.ll
test/Transforms/Inline/ignore-debug-info.ll
test/Transforms/Inline/inline_dbg_declare.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/LoopStrengthReduce/pr12018.ll
test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll
test/Transforms/LoopVectorize/X86/vectorization-remarks.ll
test/Transforms/LoopVectorize/conditional-assignment.ll
test/Transforms/LoopVectorize/control-flow.ll
test/Transforms/LoopVectorize/dbg.value.ll
test/Transforms/LoopVectorize/debugloc.ll
test/Transforms/LoopVectorize/no_array_bounds.ll
test/Transforms/LoopVectorize/no_switch.ll
test/Transforms/Mem2Reg/ConvertDebugInfo.ll
test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
test/Transforms/ObjCARC/basic.ll
test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
test/Transforms/SLPVectorizer/X86/debug_info.ll
test/Transforms/SampleProfile/branch.ll
test/Transforms/SampleProfile/calls.ll
test/Transforms/SampleProfile/discriminator.ll
test/Transforms/SampleProfile/fnptr.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/Transforms/StripSymbols/2010-08-25-crash.ll
test/Transforms/StripSymbols/strip-dead-debug-info.ll