- Replace ConstantPointerRef usage with GlobalValue usage
- Correct test ordering for GlobalValue subclass

llvm-svn: 14943
This commit is contained in:
Reid Spencer 2004-07-18 00:19:45 +00:00
parent 30d69a5af9
commit e4de22874e
1 changed files with 0 additions and 6 deletions

View File

@ -528,8 +528,6 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
Constant *ConstantCallSrc = 0;
if (Constant *CS = dyn_cast<Constant>(CI->getCalledValue()))
ConstantCallSrc = CS;
else if (GlobalValue *GV = dyn_cast<GlobalValue>(CI->getCalledValue()))
ConstantCallSrc = ConstantPointerRef::get(GV);
if (ConstantCallSrc)
NewCast = ConstantExpr::getCast(ConstantCallSrc, NewPFunTy);
@ -537,10 +535,6 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
NewCast = new CastInst(CI->getCalledValue(), NewPFunTy,
CI->getCalledValue()->getName()+"_c",CI);
// Strip off unneeded CPR's.
if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(NewCast))
NewCast = CPR->getValue();
// Create a new call instruction...
CallInst *NewCall = new CallInst(NewCast,
std::vector<Value*>(CI->op_begin()+1, CI->op_end()));