aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Utils.cpp
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-03-03 20:06:11 +0000
committerDiego Novillo <dnovillo@google.com>2014-03-03 20:06:11 +0000
commitf5041ce5583fd0dbdb362a92571a4709d063d0c1 (patch)
tree4ffc06ad33d4915d28009605c912d01c2e8f545a /llvm/lib/Transforms/Utils/Utils.cpp
parentb2f034b85e001fd79617f2124560509583118c13 (diff)
downloadllvm-f5041ce5583fd0dbdb362a92571a4709d063d0c1.zip
llvm-f5041ce5583fd0dbdb362a92571a4709d063d0c1.tar.gz
llvm-f5041ce5583fd0dbdb362a92571a4709d063d0c1.tar.bz2
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. llvm-svn: 202752
Diffstat (limited to 'llvm/lib/Transforms/Utils/Utils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Utils.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Utils.cpp b/llvm/lib/Transforms/Utils/Utils.cpp
index 3fb5463..ed4f45c6 100644
--- a/llvm/lib/Transforms/Utils/Utils.cpp
+++ b/llvm/lib/Transforms/Utils/Utils.cpp
@@ -21,6 +21,7 @@ using namespace llvm;
/// initializeTransformUtils - Initialize all passes in the TransformUtils
/// library.
void llvm::initializeTransformUtils(PassRegistry &Registry) {
+ initializeAddDiscriminatorsPass(Registry);
initializeBreakCriticalEdgesPass(Registry);
initializeInstNamerPass(Registry);
initializeLCSSAPass(Registry);