summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-14 17:53:45 +0000
committerChris Lattner <sabre@nondot.org>2002-08-14 17:53:45 +0000
commitb804760b56388c58ee8950447416b9f907c224c8 (patch)
treeb71e6dec50cbb14ae612b5133e0605a65b677919 /lib
parenta9261ff5b7c22d51578d5b2670f7ae8c205db748 (diff)
downloadexternal_llvm-b804760b56388c58ee8950447416b9f907c224c8.zip
external_llvm-b804760b56388c58ee8950447416b9f907c224c8.tar.gz
external_llvm-b804760b56388c58ee8950447416b9f907c224c8.tar.bz2
Remove support for unary operators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index b721ca0..c284b0d 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -179,8 +179,7 @@ private:
void visitReturnInst(ReturnInst &I) { /*does not have an effect*/ }
void visitTerminatorInst(TerminatorInst &TI);
- void visitUnaryOperator(Instruction &I);
- void visitCastInst(CastInst &I) { visitUnaryOperator(I); }
+ void visitCastInst(CastInst &I);
void visitBinaryOperator(Instruction &I);
void visitShiftInst(ShiftInst &I) { visitBinaryOperator(I); }
@@ -478,15 +477,14 @@ void SCCP::visitTerminatorInst(TerminatorInst &TI) {
}
}
-void SCCP::visitUnaryOperator(Instruction &I) {
+void SCCP::visitCastInst(CastInst &I) {
Value *V = I.getOperand(0);
InstVal &VState = getValueState(V);
if (VState.isOverdefined()) { // Inherit overdefinedness of operand
markOverdefined(&I);
} else if (VState.isConstant()) { // Propogate constant value
- Constant *Result = isa<CastInst>(I)
- ? ConstantFoldCastInstruction(VState.getConstant(), I.getType())
- : ConstantFoldUnaryInstruction(I.getOpcode(), VState.getConstant());
+ Constant *Result =
+ ConstantFoldCastInstruction(VState.getConstant(), I.getType());
if (Result) {
// This instruction constant folds!