similar to: [LLVMdev] How to get a return type of a function with LLVM-C API

Displaying 20 results from an estimated 400 matches similar to: "[LLVMdev] How to get a return type of a function with LLVM-C API"

2008 May 22
0
[LLVMdev] How to get a return type of a function with LLVM-C API
Hi Syoyo, > I am trying to get a return type of a function(from bitcode file) with > LLVM-C API, but there seems no appropriate API to do that. From my memory, this info is stored in the function type, so you could look at the function's type and get the info there. Looking the the API docs [1], I find that there is a simple method on Function called getReturnType(). You should thus be
2012 Oct 08
1
[LLVMdev] Fwd: Multiply i8 operands promotes to i32
Hello Pedro, As others have said we're assuming that you're using Clang as the frontend, the MSP430TargetInfo class inside lib/Basic/Targets.cpp (clang codebase) set ints to be 16 bits wide, so you should get 16bit mults straight away without promotion. But anyways for 8bit multiplicantions you can do the following to bypass argument promotion: 1) go to the lib/CodeGen/TargetInfo.cpp
2007 Dec 26
0
[LLVMdev] Instantiating modules from .bc files
Hi Danny, On 2007-12-26, at 15:39, Danny wrote: > I've noticed that the BitcodeReader appears to be an internal > module, but the BitstreamReader is public. Should I be using the > BitstreamReader? If so how. The generic BitstreamReader class is public because it's used in other projects, including clang, to serialize data structures other than LLVM IR. The coding of
2011 Sep 16
2
[LLVMdev] How to duplicate a function?
Hi all, Sorry for the inconvenient about the previous post. The files were not attached. So I put them here again. I am a newbie in LLVM and I am trying to replace the function like: old function || new function ============================== ========= int haha(int a) { int haha(int a, char* ID) { ===> }
2007 Dec 26
2
[LLVMdev] Instantiating modules from .bc files
Hey there, I'm relatively new to the llvm scene, and so far I'm liking it quite a bit. I'm a bit perplexed as to what llvm-gcc's role is in everything. I've used it to create .bc files for really simple functions and it seems to do quite well at that, but I've been trying to figure out how to take the output from llvm-gcc and actually use it in another program.
2007 Dec 27
1
[LLVMdev] Instantiating modules from .bc files
That worked quite well. Thank you. One question as a follow up: is there a nice/standard way of including the pre-made bitcode chunks in with the binaries that are being created which read them? Bascially, I'd like to have the same functionality, but rather than having one or more .bc files running around which need to be read at runtime by an executable, moving that into the code
2008 Sep 13
3
[LLVMdev] Duplicate Function with duplicated Arguments
I'm now writing a pass and I wanna ask a question about how to duplicate the function and add duplicated arguments in llvm, for example: func(int a, char *b) -> func(int a, char *b, int a1, char *b1) I'm now stuck at using "getOrInsertFunction" and how to handle "getArgumentList", please share your opinion, thanks a lot! James
2016 Sep 12
2
Counterintuitive use of LLVMBool in C-API?
Hi, I stumbled across the following: > /* Builds a module from the bitcode in the specified memory buffer, > returning a > reference to the module via the OutModule parameter. Returns 0 on success. > */ > LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf, > LLVMModuleRef *OutModule); However in most scenarios i know, a Bool is something like 0 = False !0 = True In short:
2016 Sep 12
1
Counterintuitive use of LLVMBool in C-API?
Of course, this is normal for C-APIs. But maybe change the name to LLVMResult to propagate the real use? I am not arguing about the results themself. They are standard. But the name is missguiding. As long as it's consistent i know that i have to write an extra record operator in Delphi to reflect this. 2016-09-12 11:11 GMT+02:00 David Chisnall <David.Chisnall at cl.cam.ac.uk>: > On
2009 Jan 08
2
[LLVMdev] Loop elimination with floating point counter.
Hi LLVM-ers, I'd like to eliminate dead loop with floating point counter using LLVM, but the following loop wasn't optimized by opt. void func() { float i; for (i = 0.0f; i < 1000.0f; i += 1.2f) { } } $ clang -emit-llvm-bc floop.c $ opt -std-compile-opts floop.bc | llvm-dis define void @func(...) nounwind { entry: br label %forinc forinc: ; preds = %forinc, %entry
2006 May 31
1
[LLVMdev] InstVisitor: RetType
Hi, the docs for InstVisitor say that if RetType != void, one has to override visitInstruction. What is the reason for that? It's valid to define visitInstruction like that: RetTy visitInstruction(Instruction &I) { return RetTy(); } so assuming RetTy has a sensible default constructor, user won't need to override visitInstruction. Note that the above will work when RetTy ==
2009 Jan 08
2
[LLVMdev] Loop elimination with floating point counter.
Hi Devang, Thanks. Yes, in the case variable i incremented by 1.0f is optimized. I don't know why... Anyway, I've filed this problem into bugzilla(Bug 3299) -- Syoyo On Fri, Jan 9, 2009 at 12:42 AM, Devang Patel <dpatel at apple.com> wrote: > > On Jan 8, 2009, at 4:36 AM, Syoyo Fujita wrote: > >> Hi LLVM-ers, >> >> I'd like to eliminate dead loop
2009 Jan 08
0
[LLVMdev] Loop elimination with floating point counter.
On Jan 8, 2009, at 4:36 AM, Syoyo Fujita wrote: > Hi LLVM-ers, > > I'd like to eliminate dead loop with floating point counter using > LLVM, but the following loop wasn't optimized by opt. > > void > func() { > float i; > for (i = 0.0f; i < 1000.0f; i += 1.2f) { > } > } FWIW, LLVM optimizer can eliminate this loop if i is incremented by 1.0f
2010 Jan 11
4
[LLVMdev] Operations on constant array value?
Hi, I've read http://llvm.org/docs/LangRef.html#t_array and http://llvm.org/docs/GetElementPtr.html and if I've understood right there are no operations that act directly on arrays - instead I need to use getelementptr on a pointer to an array to get a pointer to an array element. I also understand that there is no 'address of' operation. As a result I can't figure out how to
2005 Aug 24
1
[LLVMdev] CallInst constructor interface
Hi, Inserting a call instruction is a bit of a pain. The only way I know how to do it is to write a bunch of code like the following: std::vector<const Type*> formalArgs; formalArgs.push_back(arg1->getType()); formalArgs.push_back(arg2->getType()); ... formalArgs.push_back(argn->getType()); std::vector<Value*> args; args.push_back(arg1);
2009 Jan 16
1
[LLVMdev] Loop elimination with floating point counter.
On Jan 14, 2009, at 5:11 AM, Syoyo Fujita wrote: > Thanks for many comments. > > The loop with finite fp values(which could be representable in IEEE754 > fp format) such like, Sure, LLVM could definitely do this. If you're interested, I'd suggest starting by extending the existing code that we have to do this. The existing code just handles increments by unit constants,
2007 Dec 02
1
[LLVMdev] reading & writing bitcode from non file, e.g. GDBM store (or MySQL database)
Hello All, (Sorry, I probably did already ask something similar before, but I cannot recall it easily) First, I don't understand what precisely is in the /usr/local/include/llvm/Support/ directory In particular, it seems to me that nothing in the documentation says that MemoryBuffer.h in inside it.... I'm quite annoyed to understand what exactly is the public interface to LLVM! The
2010 Jan 11
2
[LLVMdev] Operations on constant array value?
2010/1/11 Eli Friedman <eli.friedman at gmail.com> > On Mon, Jan 11, 2010 at 7:07 AM, James Williams <junk at giantblob.com> > wrote: > > Hi, > > > > I've read http://llvm.org/docs/LangRef.html#t_array and > > http://llvm.org/docs/GetElementPtr.html and if I've understood right > there > > are no operations that act directly on arrays -
2013 Jul 31
1
[LLVMdev] Problem to remove successors
Hi All, I need to remove successors from every basic block to insert new ones I tried this code, but it doesn't work void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum) { assert(SuccNum < TI->getNumSuccessors() && "Trying to remove a nonexistant successor!"); // If our old successor block contains any PHI nodes, remove the entry in the //
2011 Jun 07
2
[LLVMdev] AVX Status?
Ralf Karrenberg <Chareos at gmx.de> writes: > This sounds great! > > For my case, I only require some basic support, so I am optimistic > that your next few patches will provide everything I need. If my evil plan works out, within the next 10 or so patches we should be in a place where pushing everything up goes pretty quickly. It's about 8 TableGen patches and then a