search for: gepindices

Displaying 3 results from an estimated 3 matches for "gepindices".

2004 Dec 21
3
[LLVMdev] Help with code
...rintf inserted which is causing an assertion failure. Any pointers to where I am wrong : Code Dump : Function *printFn=M.getNamedFunction(std::string("printf")); Constant *str=ConstantArray::get("Value : %d\n"); std::vector<Value *> Args(2); std::vector<Constant *> GEPIndices(2); GEPIndices[0]=Constant::getNullValue(Type::LongTy); GEPIndices[1]=Constant::getNullValue(Type::LongTy); Args[0]=ConstantExpr::getGetElementPtr(strcon,GEPIndices); Args[1]=ConstantInt::get(Type::IntTy, id); Instruction * cI= new CallInst(printFn, Args, "retprintf",instr); Thanks
2004 Dec 21
0
[LLVMdev] Help with code
...where I am wrong : > > Function *printFn=M.getNamedFunction(std::string("printf")); std::string() is unnecessary here as it's implicit. > Constant *str=ConstantArray::get("Value : %d\n"); > std::vector<Value *> Args(2); > std::vector<Constant *> GEPIndices(2); > GEPIndices[0]=Constant::getNullValue(Type::LongTy); > GEPIndices[1]=Constant::getNullValue(Type::LongTy); > Args[0]=ConstantExpr::getGetElementPtr(strcon,GEPIndices); You are using 'strcon', but you defined 'str' above. Where is 'strcon' coming from? > A...
2004 Dec 21
3
[LLVMdev] Help with code
...; Function *printFn=M.getNamedFunction(std::string("printf")); > > std::string() is unnecessary here as it's implicit. > > > Constant *str=ConstantArray::get("Value : %d\n"); > > std::vector<Value *> Args(2); > > std::vector<Constant *> GEPIndices(2); > > GEPIndices[0]=Constant::getNullValue(Type::LongTy); > > GEPIndices[1]=Constant::getNullValue(Type::LongTy); > > Args[0]=ConstantExpr::getGetElementPtr(strcon,GEPIndices); > > You are using 'strcon', but you defined 'str' above. Where is 'strcon...