From 2b0e8990ab33ec2dad21286d3ce01dbb4bbe63c1 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 18 Dec 2007 09:59:50 +0000 Subject: Rename isNoReturn to doesNotReturn, and isNoUnwind to doesNotThrow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45160 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/PruneEH.cpp | 14 +++++++------- lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- lib/Transforms/Scalar/SimplifyCFG.cpp | 4 ++-- lib/Transforms/Utils/InlineFunction.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/Transforms') diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp index b4bcd99518..69bb1f67c7 100644 --- a/lib/Transforms/IPO/PruneEH.cpp +++ b/lib/Transforms/IPO/PruneEH.cpp @@ -74,11 +74,11 @@ bool PruneEH::runOnSCC(const std::vector &SCC) { SCCMightUnwind = true; SCCMightReturn = true; } else if (F->isDeclaration()) { - SCCMightUnwind |= !F->isNoUnwind(); - SCCMightReturn |= !F->isNoReturn(); + SCCMightUnwind |= !F->doesNotThrow(); + SCCMightReturn |= !F->doesNotReturn(); } else { - bool CheckUnwind = !SCCMightUnwind && !F->isNoUnwind(); - bool CheckReturn = !SCCMightReturn && !F->isNoReturn(); + bool CheckUnwind = !SCCMightUnwind && !F->doesNotThrow(); + bool CheckReturn = !SCCMightReturn && !F->doesNotReturn(); if (!CheckUnwind && !CheckReturn) continue; @@ -98,7 +98,7 @@ bool PruneEH::runOnSCC(const std::vector &SCC) { if (CheckUnwind && !SCCMightUnwind) for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) if (CallInst *CI = dyn_cast(I)) { - if (CI->isNoUnwind()) { + if (CI->doesNotThrow()) { // This call cannot throw. } else if (Function *Callee = CI->getCalledFunction()) { CallGraphNode *CalleeNode = CG[Callee]; @@ -155,7 +155,7 @@ bool PruneEH::SimplifyFunction(Function *F) { bool MadeChange = false; for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { if (InvokeInst *II = dyn_cast(BB->getTerminator())) - if (II->isNoUnwind()) { + if (II->doesNotThrow()) { SmallVector Args(II->op_begin()+3, II->op_end()); // Insert a call instruction before the invoke. CallInst *Call = new CallInst(II->getCalledValue(), @@ -187,7 +187,7 @@ bool PruneEH::SimplifyFunction(Function *F) { for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) if (CallInst *CI = dyn_cast(I++)) - if (CI->isNoReturn() && !isa(I)) { + if (CI->doesNotReturn() && !isa(I)) { // This call calls a function that cannot return. Insert an // unreachable instruction after it and simplify the code. Do this // by splitting the BB, adding the unreachable, then deleting the diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index acda89bfe0..d64afbbda1 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -8039,7 +8039,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { } } - if (isa(Callee) && !CS.isNoUnwind()) { + if (isa(Callee) && !CS.paramHasAttr(0, ParamAttr::NoUnwind)) { // Inline asm calls cannot throw - mark them 'nounwind'. const ParamAttrsList *PAL = CS.getParamAttrs(); uint16_t RAttributes = PAL ? PAL->getParamAttrs(0) : 0; diff --git a/lib/Transforms/Scalar/SimplifyCFG.cpp b/lib/Transforms/Scalar/SimplifyCFG.cpp index 1d34d316a1..6d24404e68 100644 --- a/lib/Transforms/Scalar/SimplifyCFG.cpp +++ b/lib/Transforms/Scalar/SimplifyCFG.cpp @@ -111,7 +111,7 @@ static bool MarkAliveBlocks(BasicBlock *BB, // canonicalizes unreachable insts into stores to null or undef. for (BasicBlock::iterator BBI = BB->begin(), E = BB->end(); BBI != E;++BBI){ if (CallInst *CI = dyn_cast(BBI)) { - if (CI->isNoReturn()) { + if (CI->doesNotReturn()) { // If we found a call to a no-return function, insert an unreachable // instruction after it. Make sure there isn't *already* one there // though. @@ -135,7 +135,7 @@ static bool MarkAliveBlocks(BasicBlock *BB, // Turn invokes that call 'nounwind' functions into ordinary calls. if (InvokeInst *II = dyn_cast(BB->getTerminator())) - if (II->isNoUnwind()) { + if (II->doesNotThrow()) { ChangeToCall(II); Changed = true; } diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index 69d0e12a37..a2b834b586 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -70,7 +70,7 @@ static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock, CallInst *CI = cast(I); // If this call cannot unwind, don't convert it to an invoke. - if (CI->isNoUnwind()) + if (CI->doesNotThrow()) continue; // Convert this function call into an invoke instruction. -- cgit v1.2.3