DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 15 Apr 2015 22:29:27 +0000 (22:29 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 15 Apr 2015 22:29:27 +0000 (22:29 +0000)
commit88e419d66e38fe6606cfe15362c40765ea430deb
treee6d82cf93e08586c7bc003bcee1e2376f3b576e2
parent94255c8eb0bd037ad3f186f15b664ab680771358
DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable

Remove 'inlinedAt:' from MDLocalVariable.  Besides saving some memory
(variables with it seem to be single largest `Metadata` contributer to
memory usage right now in -g -flto builds), this stops optimization and
backend passes from having to change local variables.

The 'inlinedAt:' field was used by the backend in two ways:

 1. To tell the backend whether and into what a variable was inlined.
 2. To create a unique id for each inlined variable.

Instead, rely on the 'inlinedAt:' field of the intrinsic's `!dbg`
attachment, and change the DWARF backend to use a typedef called
`InlinedVariable` which is `std::pair<MDLocalVariable*, MDLocation*>`.
This `DebugLoc` is already passed reliably through the backend (as
verified by r234021).

This commit removes the check from r234021, but I added a new check
(that will survive) in r235048, and changed the `DIBuilder` API in
r235041 to require a `!dbg` attachment whose 'scope:` is in the same
`MDSubprogram` as the variable's.

If this breaks your out-of-tree testcases, perhaps the script I used
(mdlocalvariable-drop-inlinedat.sh) will help; I'll attach it to PR22778
in a moment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235050 91177308-0d34-0410-b5e6-96231b3b80d8
51 files changed:
docs/LangRef.rst
include/llvm/CodeGen/MachineModuleInfo.h
include/llvm/IR/DebugInfo.h
include/llvm/IR/DebugInfoMetadata.h
lib/AsmParser/LLParser.cpp
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.h
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/CodeGen/LiveDebugVariables.cpp
lib/CodeGen/MachineInstr.cpp
lib/IR/AsmWriter.cpp
lib/IR/DebugInfo.cpp
lib/IR/DebugInfoMetadata.cpp
lib/IR/LLVMContextImpl.h
lib/IR/Verifier.cpp
lib/Transforms/Utils/InlineFunction.cpp
test/Assembler/mdlocalvariable.ll
test/CodeGen/ARM/debug-info-d16-reg.ll
test/CodeGen/ARM/debug-info-s16-reg.ll
test/CodeGen/X86/dbg-changes-codegen-branch-folding.ll
test/CodeGen/X86/stack-protector-dbginfo.ll
test/DebugInfo/2010-05-03-OriginDIE.ll
test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll
test/DebugInfo/AArch64/cfi-eof-prologue.ll
test/DebugInfo/AArch64/frameindices.ll
test/DebugInfo/ARM/cfi-eof-prologue.ll
test/DebugInfo/Mips/InlinedFnLocalVar.ll
test/DebugInfo/PR20038.ll
test/DebugInfo/X86/InlinedFnLocalVar.ll
test/DebugInfo/X86/dbg-value-inlined-parameter.ll
test/DebugInfo/X86/debug-ranges-offset.ll
test/DebugInfo/X86/inline-member-function.ll
test/DebugInfo/X86/inline-seldag-test.ll
test/DebugInfo/X86/mi-print.ll
test/DebugInfo/X86/nodebug_with_debug_loc.ll
test/DebugInfo/X86/nophysreg.ll
test/DebugInfo/X86/recursive_inlining.ll
test/DebugInfo/cross-cu-inlining.ll
test/DebugInfo/inline-scopes.ll
test/DebugInfo/inlined-arguments.ll
test/DebugInfo/inlined-vars.ll
test/DebugInfo/missing-abstract-variable.ll
test/DebugInfo/namespace_inline_function_definition.ll
test/Transforms/Inline/alloca-dbgdeclare.ll
test/Transforms/Inline/inline_dbg_declare.ll
test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
unittests/IR/MetadataTest.cpp