[llvm-commits] [llvm] r45160 - in /llvm/trunk: include/llvm/Function.h include/llvm/Instructions.h include/llvm/Support/CallSite.h lib/Transforms/IPO/PruneEH.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/Transforms/Scalar/SimplifyCFG.cpp lib/Transforms/Utils/InlineFunction.cpp lib/VMCore/Instructions.cpp
Duncan Sands
baldrick at free.fr
Tue Dec 18 01:59:54 PST 2007
Author: baldrick
Date: Tue Dec 18 03:59:50 2007
New Revision: 45160
URL: http://llvm.org/viewvc/llvm-project?rev=45160&view=rev
Log:
Rename isNoReturn to doesNotReturn, and isNoUnwind to
doesNotThrow.
Modified:
llvm/trunk/include/llvm/Function.h
llvm/trunk/include/llvm/Instructions.h
llvm/trunk/include/llvm/Support/CallSite.h
llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp
llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
llvm/trunk/lib/VMCore/Instructions.cpp
Modified: llvm/trunk/include/llvm/Function.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=45160&r1=45159&r2=45160&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Function.h (original)
+++ llvm/trunk/include/llvm/Function.h Tue Dec 18 03:59:50 2007
@@ -166,12 +166,12 @@
}
/// @brief Determine if the function cannot return.
- bool isNoReturn() const {
+ bool doesNotReturn() const {
return paramHasAttr(0, ParamAttr::NoReturn);
}
/// @brief Determine if the function cannot unwind.
- bool isNoUnwind() const {
+ bool doesNotThrow() const {
return paramHasAttr(0, ParamAttr::NoUnwind);
}
Modified: llvm/trunk/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=45160&r1=45159&r2=45160&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Tue Dec 18 03:59:50 2007
@@ -940,12 +940,12 @@
}
/// @brief Determine if the call cannot return.
- bool isNoReturn() const {
+ bool doesNotReturn() const {
return paramHasAttr(0, ParamAttr::NoReturn);
}
/// @brief Determine if the call cannot unwind.
- bool isNoUnwind() const {
+ bool doesNotThrow() const {
return paramHasAttr(0, ParamAttr::NoUnwind);
}
@@ -1744,12 +1744,12 @@
}
/// @brief Determine if the call cannot return.
- bool isNoReturn() const {
+ bool doesNotReturn() const {
return paramHasAttr(0, ParamAttr::NoReturn);
}
/// @brief Determine if the call cannot unwind.
- bool isNoUnwind() const {
+ bool doesNotThrow() const {
return paramHasAttr(0, ParamAttr::NoUnwind);
}
Modified: llvm/trunk/include/llvm/Support/CallSite.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=45160&r1=45159&r2=45160&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/CallSite.h (original)
+++ llvm/trunk/include/llvm/Support/CallSite.h Tue Dec 18 03:59:50 2007
@@ -74,7 +74,7 @@
bool onlyReadsMemory() const;
/// @brief Determine if the call cannot unwind.
- bool isNoUnwind() const;
+ bool doesNotThrow() const;
/// getType - Return the type of the instruction that generated this call site
///
Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=45160&r1=45159&r2=45160&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Tue Dec 18 03:59:50 2007
@@ -74,11 +74,11 @@
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 @@
if (CheckUnwind && !SCCMightUnwind)
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
if (CallInst *CI = dyn_cast<CallInst>(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 MadeChange = false;
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator()))
- if (II->isNoUnwind()) {
+ if (II->doesNotThrow()) {
SmallVector<Value*, 8> 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 @@
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; )
if (CallInst *CI = dyn_cast<CallInst>(I++))
- if (CI->isNoReturn() && !isa<UnreachableInst>(I)) {
+ if (CI->doesNotReturn() && !isa<UnreachableInst>(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
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=45160&r1=45159&r2=45160&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Dec 18 03:59:50 2007
@@ -8039,7 +8039,7 @@
}
}
- if (isa<InlineAsm>(Callee) && !CS.isNoUnwind()) {
+ if (isa<InlineAsm>(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;
Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp?rev=45160&r1=45159&r2=45160&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp Tue Dec 18 03:59:50 2007
@@ -111,7 +111,7 @@
// 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<CallInst>(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 @@
// Turn invokes that call 'nounwind' functions into ordinary calls.
if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator()))
- if (II->isNoUnwind()) {
+ if (II->doesNotThrow()) {
ChangeToCall(II);
Changed = true;
}
Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=45160&r1=45159&r2=45160&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Tue Dec 18 03:59:50 2007
@@ -70,7 +70,7 @@
CallInst *CI = cast<CallInst>(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.
Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=45160&r1=45159&r2=45160&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Dec 18 03:59:50 2007
@@ -65,11 +65,11 @@
else
return cast<InvokeInst>(I)->onlyReadsMemory();
}
-bool CallSite::isNoUnwind() const {
+bool CallSite::doesNotThrow() const {
if (CallInst *CI = dyn_cast<CallInst>(I))
- return CI->isNoUnwind();
+ return CI->doesNotThrow();
else
- return cast<InvokeInst>(I)->isNoUnwind();
+ return cast<InvokeInst>(I)->doesNotThrow();
}
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list