CallInst* callInst = ...; // assume this is a valid CallInst object Value* firstArg = callInst->getArgOperand(0); // now you can use firstArg as needed
CallInst* callInst = ...; // assume this is a valid CallInst object unsigned int numArgs = callInst->getNumArgOperands(); for (unsigned int i = 0; i < numArgs; i++) { Value* arg = callInst->getArgOperand(i); // now you can use arg as needed }These examples are from the LLVM package library. The getArgOperand method is part of the CallInst class in the core LLVM library.