[llvm-commits] [llvm] r93977 - in /llvm/trunk: include/llvm/Metadata.h lib/VMCore/AsmWriter.cpp lib/VMCore/Metadata.cpp

Victor Hernandez vhernandez at apple.com
Tue Jan 19 22:23:49 PST 2010


On Jan 19, 2010, at 10:01 PM, Chandler Carruth wrote:

> On Tue, Jan 19, 2010 at 9:55 PM, Chandler Carruth <chandlerc at google.com> wrote:
>> On Tue, Jan 19, 2010 at 8:45 PM, Victor Hernandez <vhernandez at apple.com> wrote:
>>> +    if (Value *V = getOperand(i)) {
>>> +      if (MDNode *MD = dyn_cast<MDNode>(V))
>>> +        if (const Function *F = MD->getFunction()) return F;
>>> +      else
>>> +        return getFunctionForValue(V);
>> 
>> This else is wrong. Worse, the test actually fails if you add braces
>> to cause the behavior to follow the indentation.
> 
> FYI, I fixed the ambiguity in r93980 to be more clear but have the
> same behavior. Please review that it's still correct.

Thanks for catching my bug, Chandler.  The original indentation was what was intended; getFunctionForValue() is for non-metadata values.

I fixed this in r93984.

Victor





More information about the llvm-commits mailing list