Rename isNoReturn to doesNotReturn, and isNoUnwind to
authorDuncan Sands <baldrick@free.fr>
Tue, 18 Dec 2007 09:59:50 +0000 (09:59 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 18 Dec 2007 09:59:50 +0000 (09:59 +0000)
doesNotThrow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45160 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 2abde45f8b31d78ce6f8a47683be154d982f0fdc..2c76c9947baeaf2b76223bf466a89def1db2151b 100644 (file)
@@ -166,12 +166,12 @@ public:
   }
 
   /// @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);
   }
 
index 3c8673e627aead6c4705e4de86a288107a4cf2fb..cdce9ecdfe867cdb1d8868118a43afb1b74bca6e 100644 (file)
@@ -940,12 +940,12 @@ public:
   }
 
   /// @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 @@ public:
   }
 
   /// @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);
   }
 
index 3735842e7244be5d5844b4a2ee492f5abcb8dd3a..ce8e9fff5e35254c20f826d5da7181e2792bd02f 100644 (file)
@@ -74,7 +74,7 @@ public:
   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
   ///
index b4bcd995189cbf4de8c503c03a16c133b4674c4a..69bb1f67c74cf69d263b5cd9747c496ac62d26bb 100644 (file)
@@ -74,11 +74,11 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &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<CallGraphNode *> &SCC) {
         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 PruneEH::SimplifyFunction(Function *F) {
   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 @@ bool PruneEH::SimplifyFunction(Function *F) {
 
     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
index acda89bfe0b51fc6e3864fb55b12342dd722c01e..d64afbbda1f635ec24ab946e0f4f6f9a20b10cf2 100644 (file)
@@ -8039,7 +8039,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) {
       }
   }
 
-  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;
index 1d34d316a1d3bb629f6292b0f99edec55500ec5f..6d24404e681763a7cd7f93aff3513aa286bd1267 100644 (file)
@@ -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<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 @@ static bool MarkAliveBlocks(BasicBlock *BB,
 
     // 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;
       }
index 69d0e12a37cd3991cb34e49d96fc5464fbcaa416..a2b834b5869a6c0705097a62d36e643d3cc5051e 100644 (file)
@@ -70,7 +70,7 @@ static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
           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.
index 6c8a072c19749fa3836e177a1d513a8a12cbcf6c..3531bad2e497b094f0fa89a6074301805481641c 100644 (file)
@@ -65,11 +65,11 @@ bool CallSite::onlyReadsMemory() const {
   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();
 }
 
 //===----------------------------------------------------------------------===//