Turn DISubprogram into a variable-length node.
authorAdrian Prantl <aprantl@apple.com>
Wed, 26 Apr 2017 23:59:52 +0000 (23:59 +0000)
committerAdrian Prantl <aprantl@apple.com>
Wed, 26 Apr 2017 23:59:52 +0000 (23:59 +0000)
commit9d2f019fb63e80bfa9d50229b1f6213ccd11368a
tree1d61728491799367897347ba720a42c012dd6ef4
parent6379cfc55323ea5edbb978da7556883aea910c5b
Turn DISubprogram into a variable-length node.

DISubprogram currently has 10 pointer operands, several of which are
often nullptr. This patch reduces the amount of memory allocated by
DISubprogram by rearranging the operands such that containing type,
template params, and thrown types come last, and are only allocated
when they are non-null (or followed by non-null operands).

This patch also eliminates the entirely unused DisplayName operand.

This saves up to 4 pointer operands per DISubprogram. (I tried
measuring the effect on peak memory usage on an LTO link of an X86
llc, but the results were very noisy).

This reapplies r301498 with an attempted workaround for g++.

Differential Revision: https://reviews.llvm.org/D32560

llvm-svn: 301501
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/IR/DebugInfoMetadata.cpp
llvm/tools/opt/BreakpointPrinter.cpp