[LLVMdev] Operand name missing
Eli Friedman
eli.friedman at gmail.com
Fri Jul 1 00:59:00 PDT 2011
On Fri, Jul 1, 2011 at 12:35 AM, ankur deshwal <a.s.deshwal at gmail.com> wrote:
> Hi,
>
> I was trying to use the following code in a if condition
> I->getOperand(0)->hasName()
>
> where I is an instruction with following condition already true -
> I->getOpcode() == Instruction::Call
>
> When I compiled a C code with llvm-2.9, I see a function call with no
> operand name (for operand 0) . This happens for a function with
> varArgs. The interesting part is that the same C code when compiled
> with llvm-2.6 contains the I->getOperand(0)->Name as name of the
> function.
>
> I will try to dig in to get the reason. Can some one give me pointer
> to what can be reason for this?
The order of the operands of a CallInst changed; try using something
like "cast<CallInst>(I)->getCalledFunction()" instead.
-Eli
More information about the llvm-dev
mailing list