aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombine.h
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-05-19 01:20:42 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-05-19 01:20:42 +0000
commit6fd5a6000bb6d23d6e41f6a8b8d07ad3cca3ea76 (patch)
treef14bb422ceda32c50885d7ce1523da45ce5f9323 /lib/Transforms/InstCombine/InstCombine.h
parentc0ceedb6f885b1cbd3d3cea02f695afe393dfd2c (diff)
Make the demanded bits/elements optimizations preserve debug line information.
I'm not sure this is quite ideal, but I can't really think of any better way to do it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombine.h')
-rw-r--r--lib/Transforms/InstCombine/InstCombine.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombine.h b/lib/Transforms/InstCombine/InstCombine.h
index 9c70cf89e4..8257d6b89d 100644
--- a/lib/Transforms/InstCombine/InstCombine.h
+++ b/lib/Transforms/InstCombine/InstCombine.h
@@ -233,7 +233,15 @@ public:
Worklist.Add(New);
return New;
}
-
+
+ // InsertNewInstWith - same as InsertNewInstBefore, but also sets the
+ // debug loc.
+ //
+ Instruction *InsertNewInstWith(Instruction *New, Instruction &Old) {
+ New->setDebugLoc(Old.getDebugLoc());
+ return InsertNewInstBefore(New, Old);
+ }
+
// ReplaceInstUsesWith - This method is to be used when an instruction is
// found to be dead, replacable with another preexisting expression. Here
// we add all uses of I to the worklist, replace all uses of I with the new