search for: llvmcontextref

Displaying 20 results from an estimated 20 matches for "llvmcontextref".

2010 May 27
2
[LLVMdev] Manipulating basic blocks with the C bindings
...like the C++ API allows one to do what I'm describing, but I don't see a way to do it with the C bindings. I'd like to add the following functions. Hopefully my intent is clear. I'm very open to name suggestions, as these are a mouthful: void LLVMAppendExistingBasicBlockInContext(LLVMContextRef C, LLVMValueRef Fn, LLVMBasicBlock BB); void LLVMInsertExistingBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef InsertBeforeBB, LLVMBasicBlock BB); void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, LLVMBasicBlock BB); void LLVMInsertExistingBasicBlock(LLVMBasicBlockRef InsertBeforeBB, LLVMB...
2017 Mar 08
2
LLVMGetBitcodeModuleInContext2 problem
I'm trying to use LLVMGetBitcodeModuleInContext2 to load a .bc file. However, it's not working. The code looks something like this: void llvm_load_IR_library(char *path) { LLVMContextRef global_context; LLVMMemoryBufferRef module_path; LLVMModuleRef ir_lib_module; bool flag; module_path = LLVMCreateMemoryBufferWithMemoryRange(path, strlen(path), "path", 1); global_context = LLVMGetGlobalContext(); flag = LLVMGetBitcodeMod...
2014 May 15
3
[LLVMdev] Finding safe thread suspension points while JIT-ing (was: Add pass run listeners to the pass manager.)
...ack. >> The opaque handle was suggested by Duncan and can provide optional user specified information that is >> provided back during the callback (i.e. barrier, etc). >> >> Cheers, >> Juergen >> >> Core.h: >> typedef void (*LLVMMaySuspendCallback)(LLVMContextRef, void *); >> >> /** >> * Set the may-suspend callback function for this context. >> * >> * @see LLVMContext::setMaySuspendCallback() >> */ >> void LLVMContextSetMaySuspendCallback(LLVMContextRef C, >> LLVMMay...
2014 May 13
5
[LLVMdev] Finding safe thread suspension points while JIT-ing (was: Add pass run listeners to the pass manager.)
...context diagnostic handler and used Andy’s suggested name for the callback. The opaque handle was suggested by Duncan and can provide optional user specified information that is provided back during the callback (i.e. barrier, etc). Cheers, Juergen Core.h: typedef void (*LLVMMaySuspendCallback)(LLVMContextRef, void *); /** * Set the may-suspend callback function for this context. * * @see LLVMContext::setMaySuspendCallback() */ void LLVMContextSetMaySuspendCallback(LLVMContextRef C, LLVMMaySuspendCallback Callback, void *Op...
2019 Apr 11
2
128 bit float constant
Hi Tim, Thanks for the hint. I tried the following, (it's a C interface since that's what I need it for) where a and b are the top and bottom halves of the 128 bit value, LLVMValueRef TestConst(LLVMContextRef C, uint64_t a, uint64_t b) { Type *ty = Type::getFP128Ty(*unwrap(C)); ArrayRef<uint64_t> ar[2] = {a,b}; APInt ai(128,*ar); APFloat quad(APFloat::IEEEquad(), ai); return wrap(ConstantFP::get(ty,quad)); } but for 1.0e0 it returns zero store fp128 0xL0000000000000000000000000000000...
2017 Mar 09
2
LLVMGetBitcodeModuleInContext2 problem
...PM, Toshiyasu Morita <toshi at tensyr.com> wrote: > Made it a bit further. Here's the current code: > > void llvm_load_IR_library(char *path) > { > char *error; > LLVMExecutionEngineRef engine; > object0_t* (*func)(void), *output; > LLVMContextRef global_context; > LLVMMemoryBufferRef module; > LLVMModuleRef ir_lib_module; > bool flag; > > printf("loading IR library from path: %s\n", path); > > LLVMCreateMemoryBufferWithContentsOfFile(path, &module, &error); >...
2010 Feb 10
0
[LLVMdev] [patch] Union Types - work in progress
...UnionType::isValidElementType(const Type *ElemTy) { + return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() && + !ElemTy->isMetadataTy() && !isa<FunctionType>(ElemTy); +} Isn't there a better predicate somewhere? +LLVMTypeRef LLVMUnionTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, + unsigned ElementCount) { + std::vector<const Type*> Tys; + for (LLVMTypeRef *I = ElementTypes, + indentation of unsigned and use smallvector. +/// ParseUnionType +/// TypeRec +/// ::= 'union' '{' '}'...
2010 May 27
0
[LLVMdev] Manipulating basic blocks with the C bindings
...that same block, then call LLVMPositionBuilderAtEnd(labelBlock) and continue on your way. > > I'd like to add the following functions. Hopefully my intent is clear. > I'm very open to name suggestions, as these are a mouthful: > > void LLVMAppendExistingBasicBlockInContext(LLVMContextRef C, > LLVMValueRef Fn, LLVMBasicBlock BB); > void LLVMInsertExistingBasicBlockInContext(LLVMContextRef C, > LLVMBasicBlockRef InsertBeforeBB, LLVMBasicBlock BB); > void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, LLVMBasicBlock BB); > void LLVMInsertExistingBasicBlock(LLVMBasicBlock...
2012 Sep 27
0
[LLVMdev] Possible bug or misunderstanding of feature LLVMConstIntOfString
Hi All I am a novice LLVM user trying to use LLVMConstIntOfString using the c api to get a integer of arbitrary size from a hexadecimal string. Example code follows: LLVMContextRef context = LLVMContextCreate(); LLVMValueRef value = LLVMConstIntOfString(LLVMInt64TypeInContext(context), "0x0000000f0000ffff", 16); This is working properly as expected. However I have noticed that if the bits are not prefixed with enough zeros to correspond to 32 or 64 bits this gi...
2010 Feb 10
3
[LLVMdev] [patch] Union Types - work in progress
ping... On Thu, Jan 28, 2010 at 12:25 PM, Talin <viridia at gmail.com> wrote: > OK here's a new version of the patch - and the unions.ll test actually > passes :) > > On Mon, Jan 18, 2010 at 1:40 PM, Chris Lattner <clattner at apple.com> wrote: > >> >> On Jan 16, 2010, at 11:15 AM, Talin wrote: >> >> OK here's the patch for real this
2017 Mar 08
2
LLVMGetBitcodeModuleInContext2 problem
Or do you mean I need to load the module into memory before calling LLVMGetBitcodeModuleInContext2? > Yes, you need to load the module into memory first. > LLVMCreateMemoryBufferWithContentsOfFile will do that for you. Thanks! On Wed, Mar 8, 2017 at 3:48 PM, Friedman, Eli <efriedma at codeaurora.org> wrote: > On 3/8/2017 3:44 PM, Toshiyasu Morita wrote: > > >>
2012 Apr 25
2
[LLVMdev] Crash in JIT
...if there's anything extra I can add. -DavidM PS: below is my complete source. #include <stdio.h> #define __STDC_LIMIT_MACROS #define __STDC_CONSTANT_MACROS #include "llvm-c/Core.h" #include "llvm-c/ExecutionEngine.h" int main(int argc, const char * argv[]) { LLVMContextRef llvm; llvm = LLVMContextCreate(); LLVMModuleRef module; module = LLVMModuleCreateWithNameInContext("MyModule", llvm); //LLVMSetDataLayout(module, "i686-apple-darwin11"); <-- is needed? What is correct? LLVMSetTarget(module, "i686-apple-darwin11&q...
2009 Aug 14
0
[LLVMdev] How shall we modify llvm's OCaml binding to support LLVMContext?
...nly take a LLVMContext, such as replacing the global variable Type::FloatTy with a function Type::getFloatTy(LLVMContext&). For llvm-c though, we need to maintain backwards compatibility so we've modified LLVMFloatType() to internally use getGlobalContext(), and added LLVMFloatTypeInContext(LLVMContextRef) in order to explicitly choose which context to use. So, the question is what do we do with OCaml? Do we feel that we can break backwards compatibility and force passing around the LLVMContext, or should I follow llvm-c's lead, and add a bunch of *_in_context functions so that the API doesn'...
2017 Mar 08
2
LLVMGetBitcodeModuleInContext2 problem
...llvm-dev wrote: > >> >> I'm trying to use LLVMGetBitcodeModuleInContext2 to load a .bc file. >> However, it's not working. >> >> The code looks something like this: >> >> void llvm_load_IR_library(char *path) >> >> { >> LLVMContextRef global_context; >> LLVMMemoryBufferRef module_path; >> LLVMModuleRef ir_lib_module; >> bool flag; >> >> module_path = LLVMCreateMemoryBufferWithMemoryRange(path, >> strlen(path), "path", 1); >> > > LLVMCreateM...
2019 Apr 10
2
128 bit float constant
Hi, Just wondering if it's possible to construct a 128 bit quad precision floating point constant without converting the value back to a string. Cheers Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190410/a527f240/attachment.html>
2012 Apr 25
0
[LLVMdev] Crash in JIT
...if there's anything extra I can add. -DavidM PS: below is my complete source. #include <stdio.h> #define __STDC_LIMIT_MACROS #define __STDC_CONSTANT_MACROS #include "llvm-c/Core.h" #include "llvm-c/ExecutionEngine.h" int main(int argc, const char * argv[]) { LLVMContextRef llvm; llvm = LLVMContextCreate(); LLVMModuleRef module; module = LLVMModuleCreateWithNameInContext("MyModule", llvm); //LLVMSetDataLayout(module, "i686-apple-darwin11"); <-- is needed? What is correct? LLVMSetTarget(module, "i686-apple-darwin11&quot...
2013 May 05
0
[LLVMdev] llvm-c: Types of functions
...ing is that I must get a handle (LLVMValueRef) to the function and from that pull it's type as a LLVMTypeRef. This would be a 'function type', from which I can pull info about the return type and iterate the arguments, etc. At least, that's what I'm trying to do in my code: LLVMContextRef context = LLVMContextCreate(); LLVMMemoryBufferRef fileMemBuff; LLVMCreateMemoryBufferWithContentsOfFile( "test.bin", &fileMemBuff, &msg); LLVMModuleRef module; LLVMGetBitcodeModuleInContext( context, fileMemBuff, &module, &msg...
2010 Feb 12
1
[LLVMdev] [patch] Union Types - work in progress
...mTy->isVoidTy() && !ElemTy->isLabelTy() && > + !ElemTy->isMetadataTy() && !isa<FunctionType>(ElemTy); > +} > > Isn't there a better predicate somewhere? > Apparently there is now. Done. > > +LLVMTypeRef LLVMUnionTypeInContext(LLVMContextRef C, LLVMTypeRef > *ElementTypes, > + unsigned ElementCount) { > + std::vector<const Type*> Tys; > + for (LLVMTypeRef *I = ElementTypes, > + > > indentation of unsigned and use smallvector. > > Done. > > +/// ParseUnionType > +///...
2009 Sep 15
3
[LLVMdev] C API linking problem
...all, Does anyone have any inside why I can't get the below simple C API test to link? This is on a 32-bit Gentoo Linux system and LLVM TOT which was compiled with enable-optimized, gcc is 4.3.2. 15:26|melis at juggle2:~/c/llvmpy> cat t.c #include "llvm-c/Core.h" int main() { LLVMContextRef ctx; ctx = LLVMContextCreate(); return 0; } 15:29|melis at juggle2:~/c/llvmpy> llvm-config --cflags --ldflags --libs all -I/home/melis/llvm/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fomit-frame-pointer -fPIC -L/home/melis/llvm/lib -lpthread -ld...
2014 May 13
3
[LLVMdev] Finding safe thread suspension points while JIT-ing (was: Add pass run listeners to the pass manager.)
On May 12, 2014, at 3:52 PM, Philip Reames <listmail at philipreames.com> wrote: > I don't have a strong opinion on this topic at the moment, but given that it is potentially GC related, I figured I'd speak up. > > I see two unspoken assumptions in the thread so far: > - The runtime needs a means to bring all threads to a stop to perform some action. In particular,