search for: llvmpointertype

Displaying 12 results from an estimated 12 matches for "llvmpointertype".

2008 May 07
2
[LLVMdev] Creation of Intrinsics with Pointer Return Types
...ot able to handle all of the pointer return type instructions.<br><br>I tried using the types such as:<br><br>def llvm_vararg_ty : LLVMType<isVoid>; // this means vararg here<br>def llvm_iPTR_ty : LLVMType<iPTR><br>def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; <br>and adding types<br>def llvm_ptriAny_ty : LLVMPointerType<llvm_anyint_ty>; <br>def llvm_ptrfAny_ty : LLVMPointerType<llvm_anyfloat_ty>;<br><br>but in vain. <br>I would be happy to know the type or types...
2016 Mar 21
1
define intrinsic function with pointer-typed parameter
Hi, If I define a intrinsic function with pointer-typed parameter, for example, def llvm_foo_ptr_ty : LLVMPointerType<llvm_i16_ty>; def int_foo_get : Intrinsic<[llvm_foo_ptr_ty], [llvm_foo_ptr_ty, llvm_i32_ty], [IntrReadArgMem]>; How to lower it for the backend? I'm not sure what kind of register (i16 or i32 or i32) is needed in this case? If the parameter is LLVMPointerType<llvm_i32_ty> ins...
2008 Sep 08
3
[LLVMdev] Problems when refining type
...which seems to cause problems. I sort of feel like it probably shouldn't be found because the opaque types should be distinct, but I also don't really understand how it ought to work, so maybe I'm way off base. ------------- #include "Core.h" int main() { LLVMTypeRef a = LLVMPointerType(LLVMOpaqueType(), 0); LLVMTypeHandleRef ha = LLVMCreateTypeHandle(a); LLVMTypeRef atypes[1] = { LLVMResolveTypeHandle(ha) }; LLVMRefineType(LLVMResolveTypeHandle(ha), LLVMStructType(atypes, 1, 0)); LLVMTypeRef b = LLVMPointerType(LLVMOpaqueType(), 0); // assert here .... }...
2008 May 07
0
[LLVMdev] Creation of Intrinsics with Pointer Return Types
...uot;>; > > I am not able to handle all of the pointer return type instructions. > > I tried using the types such as: > > def llvm_vararg_ty : LLVMType<isVoid>; // this means vararg here > def llvm_iPTR_ty : LLVMType<iPTR> > def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; > and adding types > def llvm_ptriAny_ty : LLVMPointerType<llvm_anyint_ty>; > def llvm_ptrfAny_ty : LLVMPointerType<llvm_anyfloat_ty>; > > but in vain. > I would be happy to know the type or types required for handling a > pointer retu...
2007 Feb 05
0
[LLVMdev] automatically generating intrinsic declarations
On Mon, 5 Feb 2007, Dan Gohman wrote: > LLVM knows what all the types of the intrinsic functions are; I thought, > why are users (including llvm-gcc...) required to duplicate all this > information in order to use them? I mean in order to call > getOrInsertFunction to get declarations for them. That is an excellent question! :) In the bad old days, we used to allow intrinsics
2012 Sep 27
0
[LLVMdev] Possible bug or misunderstanding of feature LLVMConstIntOfString
...s hex representation to test multiple scenarios. printf("[llvmPrintf# %s] Generating code from C program: \n", moduleName); LLVMModuleRef modCEx = LLVMModuleCreateWithNameInContext(moduleName, context); // "main" function type definition: LLVMTypeRef ppInt8 = LLVMPointerType(LLVMPointerType(LLVMInt8Type(), 0), 0); LLVMTypeRef vpMainFuncTypes[] = { LLVMInt32Type(), ppInt8 }; LLVMTypeRef rMainFuncType = LLVMFunctionType(LLVMInt32Type(), vpMainFuncTypes, 2, 0); LLVMValueRef vFnMain = LLVMAddFunction(modCEx, "main", rMainFuncType); LLVMSetFunction...
2007 Feb 06
1
[LLVMdev] automatically generating intrinsic declarations
...=================================================================== RCS file: /var/cvs/llvm/llvm/include/llvm/Intrinsics.td,v retrieving revision 1.41 diff -u -r1.41 Intrinsics.td --- include/llvm/Intrinsics.td +++ include/llvm/Intrinsics.td @@ -68,6 +68,15 @@ LLVMType ElTy = elty; } +class LLVMPointerType<LLVMType elty> + : LLVMType<iPTR, "Type::PointerTyID">{ + LLVMType ElTy = elty; +} + +class LLVMEmptyStructType + : LLVMType<OtherVT, "Type::StructTyID">{ +} + def llvm_void_ty : LLVMType<isVoid, "Type::VoidTyID">; def llvm_bool_ty...
2007 Feb 05
2
[LLVMdev] automatically generating intrinsic declarations
LLVM knows what all the types of the intrinsic functions are; I thought, why are users (including llvm-gcc...) required to duplicate all this information in order to use them? I mean in order to call getOrInsertFunction to get declarations for them. So I wrote this patch, which allows all this code to be generated automatically. Is this a good approach? Dan -- Dan Gohman, Cray Inc. <djg at
2010 Aug 12
3
[LLVMdev] LLVM-C: Calling functions contained in other libraries
...(without the clutter): declare i8* @NSFullUserName() define i8* @MyFunction() { entrypoint: %myCall = call i8* @NSFullUserName() ; <i8*> [#uses=1] ret i8* %myCall } Where am I going wrong here? To add some code to my previous question: LLVMTypeRef i8Ptr(void) { return LLVMPointerType(LLVMInt8Type(), 0); } LLVMValueRef d(LLVMModuleRef module) { LLVMValueRef result; LLVMBasicBlockRef block; LLVMBuilderRef builder = LLVMCreateBuilder(); LLVMValueRef fullUsername = LLVMAddFunction(module, "NSFullUserName", LLVMFunctionType(LLVMPointerType(LLVMInt8Typ...
2008 Sep 08
0
[LLVMdev] Problems when refining type
On Mon, Sep 8, 2008 at 2:45 PM, Scott Graham <scott.llvm at h4ck3r.net> wrote: > LLVMTypeRef a = LLVMPointerType(LLVMOpaqueType(), 0); > LLVMTypeHandleRef ha = LLVMCreateTypeHandle(a); > LLVMTypeRef atypes[1] = { LLVMResolveTypeHandle(ha) }; > LLVMRefineType(LLVMResolveTypeHandle(ha), LLVMStructType(atypes, 1, 0)); > > Can anyone explain what I'm doing wrong here? It looks like a...
2013 May 05
0
[LLVMdev] llvm-c: Types of functions
...his message, so far so good else printf("Not a Func\n"); LLVMTypeRef testType; testType = LLVMTypeOf(testFunc); printf("Type is: %d\n", LLVMGetTypeKind(testType)); printf("For reference: Function: %d Pointer: %d\n", LLVMFunctionTypeKind, LLVMPointerTypeKind); if( LLVMIsFunctionVarArg(testType)) printf("is vaarg\n"); else printf("no vararg\n"); And at runtime I see that the LLVMTypeOf is corresponds to LLVMPointerTypeKind. ./app Is a Function Type is: 12 For reference: Function: 9 Pointer: 12 Assertion failed: (isa&lt...
2013 Sep 30
1
[LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
Attached is what I got thus far. What I'm struggling with is proper integration in build system. What is in there is just wild guesses from my side, both on autoconf and cmake variants. It would be great if someone with proper knowledge of the buildsystems could have a look. Also I'm not sure how to properly handle compilation on msvc - clearly "-std=c11 -Wstrict-prototypes" is