[llvm-commits] PR2765 Patch

Chris Lattner clattner at apple.com
Tue Oct 7 23:40:37 PDT 2008


On Oct 7, 2008, at 2:02 PM, Matthijs Kooijman wrote:

> Hi Andrew,
>
>> +    for (Function::const_arg_iterator I = OldFunc->arg_begin(),
>> +           E = OldFunc->arg_end(); I != E; ++I)
>> +      if (Argument* Anew = dyn_cast<Argument>(ValueMap[I]))
> What does ValueMap[I] return when the argument is removed? I would  
> expect
> NULL, but in that case you should be using dyn_cast_or_null IIRC?

This should be fine.  If the argument is removed, any uses of it have  
to be remapped to something (e.g. a constant or some other  
expression).  Arguments all must be in the map.

-Chris




More information about the llvm-commits mailing list