From: Craig Topper Date: Tue, 29 Jan 2019 23:31:54 +0000 (+0000) Subject: [IR] Use CallBase to reduce code duplication. NFC X-Git-Tag: llvmorg-10-init~13341 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b5e6b11c358e704384520dc036eddb5da1c68bf;p=platform%2Fupstream%2Fllvm.git [IR] Use CallBase to reduce code duplication. NFC Noticed in the asm-goto patch. Callbr needs to go here too. One cast and call is better than 3. Differential Revision: https://reviews.llvm.org/D57295 llvm-svn: 352563 --- diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp index 0a9434e..e031886 100644 --- a/llvm/lib/IR/Instruction.cpp +++ b/llvm/lib/IR/Instruction.cpp @@ -515,9 +515,8 @@ bool Instruction::mayReadFromMemory() const { case Instruction::CatchRet: return true; case Instruction::Call: - return !cast(this)->doesNotAccessMemory(); case Instruction::Invoke: - return !cast(this)->doesNotAccessMemory(); + return !cast(this)->doesNotAccessMemory(); case Instruction::Store: return !cast(this)->isUnordered(); } @@ -535,9 +534,8 @@ bool Instruction::mayWriteToMemory() const { case Instruction::CatchRet: return true; case Instruction::Call: - return !cast(this)->onlyReadsMemory(); case Instruction::Invoke: - return !cast(this)->onlyReadsMemory(); + return !cast(this)->onlyReadsMemory(); case Instruction::Load: return !cast(this)->isUnordered(); }