OSDN Git Service

Add optional DICompileUnit to DIBuilder + make outliner debug info use it
authorJessica Paquette <jpaquette@apple.com>
Fri, 19 Jan 2018 21:21:49 +0000 (21:21 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 19 Jan 2018 21:21:49 +0000 (21:21 +0000)
commitfa14209a6c161de3687e192b62d64457a19fcfff
treef902fa94ba95cdcf152207836fea3b69dab827d9
parent8466b57b535da1d4b69d2980cba82f0eb48e2c5c
Add optional DICompileUnit to DIBuilder + make outliner debug info use it

Previously, the DIBuilder didn't expose functionality to set its compile unit
in any other way than calling createCompileUnit. This meant that the outliner,
which creates new functions, had to create a new compile unit for its debug
info.

This commit adds an optional parameter in the DIBuilder's constructor which
lets you set its CU at construction.

It also changes the MachineOutliner so that it keeps track of the DISubprograms
for each outlined sequence. If debugging information is requested, then it
uses one of the outlined sequence's DISubprograms to grab a CU. It then uses
that CU to construct the DISubprogram for the new outlined function.

The test has also been updated to reflect this change.

See https://reviews.llvm.org/D42254 for more information. Also see the e-mail
discussion on D42254 in llvm-commits for more context.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322992 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/DIBuilder.h
lib/CodeGen/MachineOutliner.cpp
lib/IR/DIBuilder.cpp
test/CodeGen/X86/machine-outliner-disubprogram.ll