aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2013-03-29 17:42:10 -0700
committerMark Seaborn <mseaborn@chromium.org>2013-03-29 17:42:10 -0700
commitcd93e1afec966dba60433f8df5f78f10ef217f93 (patch)
tree97c1b68239f23dedd72f5283e37a4957af9d10a1 /include/llvm/Transforms
parent946417b9fe7da9334c76182f28020ff4f46e11f8 (diff)
PNaCl: Fix ExpandTls to handle a couple of corner cases involving PHI nodes
ExpandTls's use of replaceUsesOfWith() didn't work for PHI nodes containing the same Constant twice (which needs to work for same or differing incoming BasicBlocks). The same applies to ExpandTlsConstantExpr. I noticed this while implementing ExpandConstantExpr. Fix this and factor out some common code that all three passes can use. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2837 TEST=test/Transforms/NaCl/*.ll Review URL: https://codereview.chromium.org/13128002
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r--include/llvm/Transforms/NaCl.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Transforms/NaCl.h b/include/llvm/Transforms/NaCl.h
index 58166bbf22..0a857653ba 100644
--- a/include/llvm/Transforms/NaCl.h
+++ b/include/llvm/Transforms/NaCl.h
@@ -14,7 +14,10 @@ namespace llvm {
class BasicBlockPass;
class FunctionPass;
+class Instruction;
class ModulePass;
+class Use;
+class Value;
FunctionPass *createExpandConstantExprPass();
ModulePass *createExpandCtorsPass();
@@ -26,6 +29,9 @@ ModulePass *createGlobalCleanupPass();
ModulePass *createResolveAliasesPass();
ModulePass *createStripMetadataPass();
+Instruction *PhiSafeInsertPt(Use *U);
+void PhiSafeReplaceUses(Use *U, Value *NewVal);
+
}
#endif