Fixed a bug in the IR transformer where we were
trying to do replaceUsesOfWith on a constant,
which doesn't work. Turns out we don't need to
do anything for constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109477 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/IRForTarget.cpp b/source/Expression/IRForTarget.cpp
index e201117..ce28a8f 100644
--- a/source/Expression/IRForTarget.cpp
+++ b/source/Expression/IRForTarget.cpp
@@ -186,7 +186,16 @@
for (ui = guard_load->use_begin();
ui != guard_load->use_end();
++ui)
- ui->replaceUsesOfWith(guard_load, zero);
+ {
+ if (isa<Constant>(ui))
+ {
+ // do nothing for the moment
+ }
+ else
+ {
+ ui->replaceUsesOfWith(guard_load, zero);
+ }
+ }
guard_load->eraseFromParent();
}