[LLVMdev] Inrinsic Creation Problem

Aditya Vishnubhotla Vijay aditya at iss.tu-darmstadt.de
Tue Feb 12 04:13:22 PST 2008


Hi,
I tried creating 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

The following are the additions made to the
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,bbp);	/*bbp is pointer to basic block where 
intrinsic is to be inserted*/

Errors: 


/work/aditya/llvm-2.1/Debug/bin/opt(llvm::FunctionType::FunctionType(llvm::Type
const*, std::vector<llvm::Type const*,
std::allocator<llvm::Type const*> > const&, bool,
llvm::ParamAttrsList const*)+0x6a)[0x85ea1d0]

/work/aditya/llvm-2.1/Debug/bin/opt(llvm::FunctionType::get(llvm::Type
const*, std::vector<llvm::Type const*,
std::allocator<llvm::Type const*> > const&, bool,
llvm::ParamAttrsList const*)+0xc5)[0x85ecd01]

/work/aditya/llvm-2.1/Debug/bin/opt(llvm::Intrinsic::getType(llvm::Intrinsic::ID,
llvm::Type const**, unsigned int)+0x3f8e)[0x85ad73e]

/work/aditya/llvm-2.1/Debug/bin/opt(llvm::Intrinsic::getDeclaration(llvm::Module*,llvm::Intrinsic::ID,llvm::Type 
const**, unsigned int)+0x20)[0x85ad8ea]





More information about the llvm-dev mailing list