search for: functyp

Displaying 14 results from an estimated 14 matches for "functyp".

Did you mean: functype
2013 May 21
1
[LLVMdev] Is it valid to add parameters to a function once it is created
...n empty signature: void llvm_start_new_function() { llvm::outs() << "Staring new LLVM function ...\n"; Mod = new llvm::Module("module", llvm::getGlobalContext()); builder = new llvm::IRBuilder<>(llvm::getGlobalContext()); llvm::FunctionType *funcType = llvm::FunctionType::get(builder->getVoidTy(), false); mainFunc = llvm::Function::Create(funcType, llvm::Function::ExternalLinkage, "main", Mod); llvm::BasicBlock* entry = llvm::BasicBlock::Create(llvm::getGlobalContext(), "entrypoint", mainFunc); builder...
2012 Apr 25
2
[LLVMdev] Crash in JIT
...oduleCreateWithNameInContext("MyModule", llvm); //LLVMSetDataLayout(module, "i686-apple-darwin11"); <-- is needed? What is correct? LLVMSetTarget(module, "i686-apple-darwin11"); LLVMTypeRef int32 = LLVMInt32TypeInContext(llvm); LLVMTypeRef funcType; LLVMTypeRef threeInts[] = {int32, int32, int32}; funcType = LLVMFunctionType(int32, threeInts, 3, 0); LLVMValueRef func; func = LLVMAddFunction(module, "functionName", funcType); LLVMValueRef mParam = LLVMGetParam(func, 0); LLVMSetValueName(mParam, "m&...
2015 Mar 10
4
[LLVMdev] noob IR builder question
...lvm; 2 3 llvm::Module *module; 4 llvm::IRBuilder<> builder(getGlobalContext()); 5 6 int main(int argc, const char * argv[]) { 7 llvm::LLVMContext & context = llvm::getGlobalContext(); 8 module = new llvm::Module("calc", context); 9 10 11 llvm::FunctionType *funcType = llvm::FunctionType::get(builder.getVoidTy(), false); 12 llvm::Function *mainFunc = 13 llvm::Function::Create(funcType, llvm::Function::ExternalLinkage, "main", module); 14 llvm::BasicBlock *entry = llvm::BasicBlock::Create(context, "entrypoint", mainFunc); 15 builde...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...LLVMModuleCreateWithNameInContext("MyModule", llvm); //LLVMSetDataLayout(module, "i686-apple-darwin11"); <-- is needed? What is correct? LLVMSetTarget(module, "i686-apple-darwin11"); LLVMTypeRef int32 = LLVMInt32TypeInContext(llvm); LLVMTypeRef funcType; LLVMTypeRef threeInts[] = {int32, int32, int32}; funcType = LLVMFunctionType(int32, threeInts, 3, 0); LLVMValueRef func; func = LLVMAddFunction(module, "functionName", funcType); LLVMValueRef mParam = LLVMGetParam(func, 0); LLVMSetValueName(mParam, "m&quo...
2007 Jul 20
5
[LLVMdev] Seg faulting on vector ops
...for (unsigned int i = 0 ; i < dim ; ++i) v = new InsertElementInst(v,s,i,"v",basicBlock); return v; } Function* generateVectorAndSelect(Module* pModule) { std::vector<Type const*> params; params.push_back(Type::FloatTy); FunctionType* funcType = FunctionType::get(Type::FloatTy,params,NULL); Function* func = cast<Function>(pModule->getOrInsertFunction("vSelect3",funcType)); BasicBlock* basicBlock = new BasicBlock("body",func); Function::arg_iterator args = func->arg_begin(); Argum...
2012 Jul 06
2
[LLVMdev] Self-referential function pointer
Hey guys, I could use some advice on a special case of a function pointer as a formal argument. I would like the function pointer type to contain the actual signature of the function, i.e. not a pointer to var args function. This becomes an issue when I have a function which can take a pointer to itself as an argument... our terminology for this is "a recursive procedure". That is, of
2007 Jul 21
0
[LLVMdev] Seg faulting on vector ops
..."v",basicBlock); > > > > return v; > > } > > > > Function* generateVectorAndSelect(Module* pModule) > > { > > std::vector<Type const*> params; > > > > params.push_back(Type::FloatTy); > > > > FunctionType* funcType = > FunctionType::get(Type::FloatTy,params,NULL); > > Function* func = > cast<Function>(pModule->getOrInsertFunction("vSelect3",funcType)); > > > > BasicBlock* basicBlock = new BasicBlock("body",func); > > > > Function::arg_...
2007 Jul 24
2
[LLVMdev] Seg faulting on vector ops
...;> } >> >> >> >> Function* generateVectorAndSelect(Module* pModule) >> >> { >> >> std::vector<Type const*> params; >> >> >> >> params.push_back(Type::FloatTy); >> >> >> >> FunctionType* funcType = >> FunctionType::get(Type::FloatTy,params,NULL); >> >> Function* func = >> cast<Function>(pModule->getOrInsertFunction("vSelect3",funcType)); >> >> >> >> BasicBlock* basicBlock = new BasicBlock("body",func); >&...
2007 Jul 20
0
[LLVMdev] Seg faulting on vector ops
...t;v",basicBlock); > > > > return v; > > } > > > > Function* generateVectorAndSelect(Module* pModule) > > { > > std::vector<Type const*> params; > > > > params.push_back(Type::FloatTy); > > > > FunctionType* funcType = FunctionType::get > (Type::FloatTy,params,NULL); > > Function* func = cast<Function>(pModule->getOrInsertFunction > ("vSelect3",funcType)); > > > > BasicBlock* basicBlock = new BasicBlock("body",func); > > > > Functio...
2007 Jul 26
0
[LLVMdev] Seg faulting on vector ops
...tion* generateVectorAndSelect(Module* pModule) >>> >>> { >>> >>> std::vector<Type const*> params; >>> >>> >>> >>> params.push_back(Type::FloatTy); >>> >>> >>> >>> FunctionType* funcType = >>> FunctionType::get(Type::FloatTy,params,NULL); >>> >>> Function* func = >>> cast<Function>(pModule->getOrInsertFunction("vSelect3",funcType)); >>> >>> >>> >>> BasicBlock* basicBlock = new BasicBlo...
2012 Jan 23
1
[LLVMdev] Code crashing in CreateGlobalStringPtr, passes when I add code for main routine + entry
...nclude <vector> #include <cstdio> #include <string> int main() { llvm::LLVMContext & context = llvm::getGlobalContext(); llvm::Module *module = new llvm::Module("asdf", context); llvm::IRBuilder<> builder(context); // Added extra llvm::FunctionType *funcType = llvm::FunctionType::get(builder.getVoidTy(), false); llvm::Function *mainFunc = llvm::Function::Create(funcType, llvm::Function::ExternalLinkage, "main", module); llvm::BasicBlock *entry = llvm::BasicBlock::Create(context, "entry", mainFunc); builder.SetInsertPoint(entr...
2003 Dec 14
2
[LLVMdev] An assembly level interface for LLVM
...ample creating function types takes like 4-5 lines of code, but nothing interesting goes on there. I think we can get rid of such code by providing an LLVM assembly language parsing library. For example, a type parser may look something like: TypeParser p("uint x uinx -> void"); Type* FuncType = p.getType(); The same thing can be extended to an LLVM snippet parser, which will parse LLVM instruction. We can use $1, $2 etc as paramaters, so that snippets can be instantiated with specific arguments. Do others think this functionality will be useful? Thanks, Rahul
2014 Aug 02
2
[LLVMdev] LLVM Basic Program Compilation
Thank you Chris. I am using llvm-3.4.2. I am facing the same issue when using clang++ as well. $ clang++ try.cpp -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS `llvm-config --cxxflags --ldflags --libs` -S -emit-llvm gives me errors $clang++ try.cpp -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -S -emit-llvm $ lli try.s gives me Program used external function
2003 Dec 14
0
[LLVMdev] An assembly level interface for LLVM
...takes like 4-5 lines of code, but > nothing interesting goes on there. I think we can get rid of > such code by providing an LLVM assembly language parsing > library. For example, a type parser may look something like: > > TypeParser p("uint x uinx -> void"); > Type* FuncType = p.getType(); > > The same thing can be extended to an LLVM snippet parser, > which will parse LLVM instruction. We can use $1, $2 etc as > paramaters, so that snippets can be instantiated with > specific arguments. > > Do others think this functionality will be useful? &g...