[LLVMdev] Problem with variable argument intrinsics
aditya vishnubhotla
vvaditya12 at yahoo.com
Tue Feb 19 01:11:22 PST 2008
Hi,
I tried creating variable argument intrinsics which
are to be placeholders for some instructions which
should not be executed by the backend.
Kindly help me with the errors in my "migrate_begin"
intrinsic creation
//Additions made to Intrinsics.td file:
def llvm_migrate_begin : LLVMType<iAny>;
def int_migrate_begin :
Intrinsic<[llvm_migrate_begin,llvm_vararg_ty],[IntrWriteMem],"llvm.migrate_begin">;
//A section of the code which deals with the
//"migrate_begin" intrinsic creation is as follows:
const Type **Tys=(const
Type**)calloc(extTys.size(),sizeof(Type*)); /*
extTys
vector contains data types(pointers) of formal
parameters of the
function "f" */
int i=0;
for(vector<const Type*>::iterator
it=extTys.begin(),e=extTys.end();it!=e;it++)
{Tys[i++]=*it;}
extTys.clear();
Module *M = bbp->getParent()->getParent();
Function *f =
Intrinsic::getDeclaration(M,Intrinsic::migrate_begin,Tys,i);
/*
migrate_begin intrinsic creation */
CallInst* CI = new CallInst(f,"migrate_begin",bbp);
/*bbp is pointer to basic block where
intrinsic is to be inserted*/
//Errors:
Overloaded intrinsic has incorrect suffix: '.i32.i32'.
It should be '.i32'
i32 (...)* @llvm.migrate_begin.i32.i32
Overloaded intrinsic has incorrect suffix:
'.i32.i32.i32'. It should be '.i32'
i32 (...)* @llvm.migrate_begin.i32.i32.i32
Broken module found, compilation aborted!
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
More information about the llvm-dev
mailing list