[PATCH] D57295: [IR] Use CallBase to reduce code duplication. NFC

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 29 15:31:54 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL352563: [IR] Use CallBase to reduce code duplication. NFC (authored by ctopper, committed by ).

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57295/new/

https://reviews.llvm.org/D57295

Files:
  llvm/trunk/lib/IR/Instruction.cpp


Index: llvm/trunk/lib/IR/Instruction.cpp
===================================================================
--- llvm/trunk/lib/IR/Instruction.cpp
+++ llvm/trunk/lib/IR/Instruction.cpp
@@ -515,9 +515,8 @@
   case Instruction::CatchRet:
     return true;
   case Instruction::Call:
-    return !cast<CallInst>(this)->doesNotAccessMemory();
   case Instruction::Invoke:
-    return !cast<InvokeInst>(this)->doesNotAccessMemory();
+    return !cast<CallBase>(this)->doesNotAccessMemory();
   case Instruction::Store:
     return !cast<StoreInst>(this)->isUnordered();
   }
@@ -535,9 +534,8 @@
   case Instruction::CatchRet:
     return true;
   case Instruction::Call:
-    return !cast<CallInst>(this)->onlyReadsMemory();
   case Instruction::Invoke:
-    return !cast<InvokeInst>(this)->onlyReadsMemory();
+    return !cast<CallBase>(this)->onlyReadsMemory();
   case Instruction::Load:
     return !cast<LoadInst>(this)->isUnordered();
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57295.184194.patch
Type: text/x-patch
Size: 941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190129/1a82f00c/attachment.bin>


More information about the llvm-commits mailing list