Displaying 3 results from an estimated 3 matches for "c_defs".
2010 Jan 08
4
[LLVMdev] Inlining
...lining.
define linkonce fastcc i32 @foo(i32 %arg) alwaysinline
{
%result = mul i32 %arg, 7
ret i32 %result
}
define i32
@main(i32 %argc, i8 **%argv)
{
%retVal = call fastcc i32 @foo(i32 6) alwaysinline
ret i32 %retVal
}
---
and bumped up the optimization level to O3:
rm -f nil c_defs c_defs.llh *.bc *.s *.o testInline # *.ll
gemini:~/Projects/Nil/nil(0)$ make testInline.s testInline
llvm-as testInline.ll
llc -O3 -f testInline.bc
cc testInline.s -o testInline
rm testInline.bc
gemini:~/Projects/Nil/nil(0)$
which generates
---
.file "testInline.bc"
.section .g...
2010 Feb 12
0
[LLVMdev] Portable I/O
Thanks everyone, a set of wrapper routines it will be then.
Dustin, are the routines you wrote open source or do you know if there is
already a project that provides such a portable interface to libc for LLVM?
If not, I'll write my own routines, but if there is a way to adopt a common
standard or avoid reinventing the wheel I'm all for it.
Mike
2010 Feb 12
2
[LLVMdev] Portable I/O
On 02/12/2010 09:51 AM, Chris Lattner wrote:
> I think that the point is that you can define your own standard runtime interfaces:
>
> void *myopen(const char*path) {
> return fopen(path, ...);
> }
Maybe my experience hand-coding LLVM will actually be of some help.
What I did for this case is what I think Chris is suggesting--I have a
.c file with functions that return