diff options
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 10 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LowerGC.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/Reg2Mem.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 8 |
4 files changed, 11 insertions, 11 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 12a886a..8ef285a 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -7234,7 +7234,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { // Check to see if we are changing the return type... if (OldRetTy != FT->getReturnType()) { - if (Callee->isExternal() && !Caller->use_empty() && + if (Callee->isDeclaration() && !Caller->use_empty() && OldRetTy != FT->getReturnType() && // Conversion is ok if changing from pointer to int of same size. !(isa<PointerType>(FT->getReturnType()) && @@ -7270,11 +7270,11 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { ParamTy->getPrimitiveSizeInBits() >= ActTy->getPrimitiveSizeInBits()) || (c && ParamTy->getPrimitiveSizeInBits() >= ActTy->getPrimitiveSizeInBits() && c->getSExtValue() > 0); - if (Callee->isExternal() && !isConvertible) return false; + if (Callee->isDeclaration() && !isConvertible) return false; } if (FT->getNumParams() < NumActualArgs && !FT->isVarArg() && - Callee->isExternal()) + Callee->isDeclaration()) return false; // Do not delete arguments unless we have a function body... // Okay, we decided that this is a safe thing to do: go ahead and start @@ -8102,14 +8102,14 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { // Instcombine load (constant global) into the value loaded. if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Op)) - if (GV->isConstant() && !GV->isExternal()) + if (GV->isConstant() && !GV->isDeclaration()) return ReplaceInstUsesWith(LI, GV->getInitializer()); // Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded. if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Op)) if (CE->getOpcode() == Instruction::GetElementPtr) { if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0))) - if (GV->isConstant() && !GV->isExternal()) + if (GV->isConstant() && !GV->isDeclaration()) if (Constant *V = ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE)) return ReplaceInstUsesWith(LI, V); diff --git a/lib/Transforms/Scalar/LowerGC.cpp b/lib/Transforms/Scalar/LowerGC.cpp index fa06bd0..a989813 100644 --- a/lib/Transforms/Scalar/LowerGC.cpp +++ b/lib/Transforms/Scalar/LowerGC.cpp @@ -130,7 +130,7 @@ bool LowerGC::doInitialization(Module &M) { GlobalValue::LinkOnceLinkage, Constant::getNullValue(PRLTy), "llvm_gc_root_chain", &M); - } else if (RootChain->hasExternalLinkage() && RootChain->isExternal()) { + } else if (RootChain->hasExternalLinkage() && RootChain->isDeclaration()) { RootChain->setInitializer(Constant::getNullValue(PRLTy)); RootChain->setLinkage(GlobalValue::LinkOnceLinkage); } diff --git a/lib/Transforms/Scalar/Reg2Mem.cpp b/lib/Transforms/Scalar/Reg2Mem.cpp index ee4a228..a5faa42 100644 --- a/lib/Transforms/Scalar/Reg2Mem.cpp +++ b/lib/Transforms/Scalar/Reg2Mem.cpp @@ -49,7 +49,7 @@ namespace { } virtual bool runOnFunction(Function &F) { - if (!F.isExternal()) { + if (!F.isDeclaration()) { //give us a clean block BasicBlock* bbold = &F.getEntryBlock(); BasicBlock* bbnew = new BasicBlock("allocablock", &F, &F.getEntryBlock()); diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 5d05ef8..f09ff0e 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -1021,7 +1021,7 @@ void SCCPSolver::visitLoadInst(LoadInst &I) { // Transform load (constant global) into the value loaded. if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) { if (GV->isConstant()) { - if (!GV->isExternal()) { + if (!GV->isDeclaration()) { markConstant(IV, &I, GV->getInitializer()); return; } @@ -1040,7 +1040,7 @@ void SCCPSolver::visitLoadInst(LoadInst &I) { if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) if (CE->getOpcode() == Instruction::GetElementPtr) if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0))) - if (GV->isConstant() && !GV->isExternal()) + if (GV->isConstant() && !GV->isDeclaration()) if (Constant *V = ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE)) { markConstant(IV, &I, V); @@ -1088,7 +1088,7 @@ void SCCPSolver::visitCallSite(CallSite CS) { return; } - if (F == 0 || !F->isExternal() || !canConstantFoldCallTo(F)) { + if (F == 0 || !F->isDeclaration() || !canConstantFoldCallTo(F)) { markOverdefined(IV, I); return; } @@ -1486,7 +1486,7 @@ bool IPSCCP::runOnModule(Module &M) { hash_map<Value*, LatticeVal> &Values = Solver.getValueMapping(); for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) if (!F->hasInternalLinkage() || AddressIsTaken(F)) { - if (!F->isExternal()) + if (!F->isDeclaration()) Solver.MarkBlockExecutable(F->begin()); for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI) |