]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commit
Pass to emit DWARF path discriminators.
authorDiego Novillo <dnovillo@google.com>
Mon, 3 Mar 2014 20:06:11 +0000 (20:06 +0000)
committerDiego Novillo <dnovillo@google.com>
Mon, 3 Mar 2014 20:06:11 +0000 (20:06 +0000)
commitf05b45fdb2d04db7bc1cde4529ebe0afdb9be148
tree9a61f45d821e89428889bb03b6ee7852984daf66
parent9efaf2f2dad82d5455970af0370edace405791b2
Pass to emit DWARF path discriminators.

DWARF discriminators are used to distinguish multiple control flow paths
on the same source location. When this happens, instructions across
basic block boundaries will share the same debug location.

This pass detects this situation and creates a new lexical scope to one
of the two instructions. This lexical scope is a child scope of the
original and contains a new discriminator value. This discriminator is
then picked up from MCObjectStreamer::EmitDwarfLocDirective to be
written on the object file.

This fixes http://llvm.org/bugs/show_bug.cgi?id=18270.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202752 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo.h
include/llvm/InitializePasses.h
include/llvm/Transforms/Scalar.h
lib/IR/DebugInfo.cpp
lib/IR/LLVMContextImpl.h
lib/Transforms/Utils/AddDiscriminators.cpp [new file with mode: 0644]
lib/Transforms/Utils/CMakeLists.txt
lib/Transforms/Utils/Utils.cpp
test/Transforms/AddDiscriminators/basic.ll [new file with mode: 0644]
test/Transforms/AddDiscriminators/first-only.ll [new file with mode: 0644]
test/Transforms/AddDiscriminators/multiple.ll [new file with mode: 0644]