similar to: [LLVMdev] Problem invoking win32 api calls (Eli Friedman)

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Problem invoking win32 api calls (Eli Friedman)"

2009 Jan 23
1
[LLVMdev] Problem invoking win32 api calls
Hi, I use the kaliedoscope tutorial to do some experiments. I'm trying to define a few win32 functions as extern and execute them from the toy language. Functions that take no arguments execute fine (for example, GetLastError()). However, calling functions that do take arguments (for example, SetLastError(unsigned int)) always crash the application due to some kind of stack corruption
2013 Oct 28
0
[LLVMdev] __fastcall jitting
Hi, We're using LLVM MCJIT on X86 platform. When calling Function::setCallingConv(CallingConv::X86_StdCall) the jitted code indeed conforms __stdcall convention (instead of default __cdecl). However applying Function::setCallingConv(CallingConv::X86_FastCall) seem does not have proper effect; jitted code is still __stdcall. Is it a bug, or am I missing something? Regards, Mikhail
2011 Sep 16
0
[LLVMdev] How to duplicate a function?
Hi all, 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) { ===> } } Of course in the newly replaced function "int haha(int,
2010 Apr 28
1
[LLVMdev] LLVM Tutorial 1: Something got wrong?
it seems the code snippit below cann't be compiled throuth. the compiler complains: error: no matching function for call to ‘llvm::IntegerType::get(int)’ /usr/local/include/llvm/DerivedTypes.h:108: note: candidates are: static const llvm::IntegerType* llvm::IntegerType::get(llvm::LLVMContext&, unsigned int) Module* makeLLVMModule() { // Module Construction Module* mod = new
2007 Oct 05
0
[LLVMdev] RFC: Tail call optimization X86
Hi Evan, I incoporated the changes you request but to the following i have got a question: > Also, moving the option > there will allow us to change fastcc ABI (callee popping arguments) > only when this option is on. See Chris' email: I am not to sure on that. because that would make modules compiled with the flag on incompatible with ones compiled without the flag off as
2007 Apr 06
1
[LLVMdev] Integrating LLVM in an existing project
Hi Chris, > The static code generator works for many simple cases, but it is currently > disabled. To enable it, uncomment this line in > llvm-gcc/gcc/llvm-convert.cpp: > > //#define ITANIUM_STYLE_EXCEPTIONS > > > Based on that, you should be able to compile simple C++ codes that throw > and catch exceptions. The next step would be to make a .bc file, run it
2007 Oct 05
0
[LLVMdev] RFC: Tail call optimization X86
On Oct 5, 2007, at 10:41 AM, Evan Cheng wrote: > > On Oct 5, 2007, at 2:42 AM, Arnold Schwaighofer wrote: > >> Hi Evan, >> I incoporated the changes you request but to the following i have got >> a question: >> >>> Also, moving the option >>> there will allow us to change fastcc ABI (callee popping arguments) >>> only when this option is
2012 Jun 17
3
[LLVMdev] BlockAddress instruction is copied instead of cloned during module link?
I have a module having the blockaddress instruction. When I link it into another module and delete the original, blockaddress disappears and is replaced by inttoptr (i32 1 to i8*). Please compile and run the attached program to see the demo of this problem. Right after linking modules, blockaddress still exists: @switch.bbs = internal global [3 x i8*] [i8* blockaddress(@my_func,
2010 May 11
2
[LLVMdev] How to create Global Variables using LLVM API?
I am new to LLVM API. and I am experimenting with it. I want to create Global Variables in a module. I am able to create local variables using IRBuilder class. I tried using GlobalVariable class to create global variables. but it doesn't work. my code looks like this: Module* mod = new Module("test", getGlobalContext()); Constant* c = mod->getOrInsertFunction("main",
2010 May 11
0
[LLVMdev] How to create Global Variables using LLVM API?
subramanyam wrote: > > I am new to LLVM API. and I am experimenting with it. > I want to create Global Variables in a module. > I am able to create local variables using IRBuilder class. I tried using > GlobalVariable class to create global variables. > but it doesn't work. my code looks like this: > > Module* mod = new Module("test", getGlobalContext()); >
2013 Sep 03
1
[LLVMdev] X86_thiscall
Hi everyone, I have some problems with gettings the X86_thiscall calling convention to work. I am new to LLVM, so if this is the wrong place for this question then I appologise, please tell me where to go instead. I am generating code to call a member function of a class compiled with Microsoft Visual C++ using the JIT compiler. The following code is used to register the pointer to the
2007 Oct 05
6
[LLVMdev] RFC: Tail call optimization X86
On Oct 5, 2007, at 2:42 AM, Arnold Schwaighofer wrote: > Hi Evan, > I incoporated the changes you request but to the following i have got > a question: > >> Also, moving the option >> there will allow us to change fastcc ABI (callee popping arguments) >> only when this option is on. See Chris' email: > > I am not to sure on that. because that would make
2016 Jun 20
7
Suggestion / Help regarding new calling convention
Dear Community, To improve current interprocedural register allocation (IPRA) , we have planned to set callee saved registers to none for local functions, currently I am doing it in following way: if (F->hasLocalLinkage() && !F->hasAddressTaken()) { DEBUG(dbgs() << "Function has LocalLinkage \n"); F->setCallingConv(CallingConv::GHC); } but we think threre
2011 Apr 05
3
[LLVMdev] inserting a print statement into IR
Hi Everyone, I am trying to construct the print statement : printf("value:%d\n", value); This is my llvm code. It is seg faulting at builder.CreateGlobalStringPtr(str,""). Thanks. George vector<const Type *> params; params.push_back(Type::getInt8PtrTy(M.getContext())); FunctionType *fType = FunctionType::get(Type::getInt32Ty(M.getContext()), params, true); Constant
2016 Jun 24
2
Suggestion / Help regarding new calling convention
On Tue, Jun 21, 2016 at 12:31 AM, Matthias Braun <matze at braunis.de> wrote: > I just discussed this with vivek on IRC (and I think we agreed on this): > > Let me first state the motivation clearly to ease later discussions: > As far as the motivation for this change goes: Changing the calling > convention allows us to choose whether a register is saved by the callee or >
2016 Jun 21
2
Suggestion / Help regarding new calling convention
> On Jun 20, 2016, at 11:12 AM, John Criswell via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > On 6/20/16 9:39 AM, vivek pandya via llvm-dev wrote: >> Dear Community, >> >> To improve current interprocedural register allocation (IPRA) , we have planned to set callee saved registers to none for local functions, currently I am doing it in following way:
2013 Nov 26
2
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
Hello, using the LLVM API, I've build one very simple function that adds two ConstantInts and returns the result. I noticed that, when I emit IR code, it is optimized to a simple "ret i16 42" when I add 40 and 2. I'd like to see the operations that are necessary to compute the result, though. Can I somehow disable this optimization in the pass, leading to more verbose IR code?
2011 Apr 05
0
[LLVMdev] inserting a print statement into IR
On 4/4/2011 6:26 PM, George Baah wrote: > Hi Everyone, > I am trying to construct the print statement : printf("value:%d\n", > value); > This is my llvm code. It is seg faulting at > builder.CreateGlobalStringPtr(str,""). This might be easier to debug with a stack trace. Use a debugger to see the call stack when the segfault occurs. Also try to isolate
2013 Nov 28
0
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
IRBuilder is a templated class, and one of the template arguments is the constant folder to use. By default it uses the ConstantFolder class which does target-independant constant folding. If you want to disable constant folding you can specify the NoFolder class instead, i.e. declare the builder as follows: IRBuilder<true, llvm::NoFolder> builder(body) On 26 Nov 2013, at 19:23, Daniel
2011 Apr 01
3
[LLVMdev] insert printf into IR
Hi All, I am trying to insert printf ("%d", v), where v is an integer param, into the IR. I am doing something wrong because I keep getting segfaults. Below is my code. Thanks. vector<const Type *> params; params.push_back(Type::getInt8PtrTy(M.getContext())); params.push_back(Type::getInt32Ty(M.getContext())); FunctionType *fType =