[llvm] r370217 - [NFC] Added a comment to avoid possible confusion
David Bolvansky via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 08:04:48 PDT 2019
Author: xbolva00
Date: Wed Aug 28 08:04:48 2019
New Revision: 370217
URL: http://llvm.org/viewvc/llvm-project?rev=370217&view=rev
Log:
[NFC] Added a comment to avoid possible confusion
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=370217&r1=370216&r2=370217&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Wed Aug 28 08:04:48 2019
@@ -4183,8 +4183,10 @@ static void annotateAnyAllocSite(CallBas
ConstantInt *Op1C = (Call.getNumArgOperands() == 1)
? nullptr
: dyn_cast<ConstantInt>(Call.getOperand(1));
+ // Bail out if the allocation size is zero.
if ((Op0C && Op0C->isNullValue()) || (Op1C && Op1C->isNullValue()))
return;
+
if (isMallocLikeFn(&Call, TLI) && Op0C) {
Call.addAttribute(AttributeList::ReturnIndex,
Attribute::getWithDereferenceableOrNullBytes(
More information about the llvm-commits
mailing list