Displaying 20 results from an estimated 8000 matches similar to: "[LLVMdev] Is va_arg deprecated?"
2010 Jul 19
0
[LLVMdev] Is va_arg deprecated?
Neal,
FYI, my group has added a flag to llvm-gcc for emitting the va_arg
instruction (instead of lowering in the front-end),
and we also have an implementation of the VAARG instruction for
X86-64. (which is currently not implemented in the LLVM backend).
Both of these things will be sent upstream to LLVM soon, pending some
more testing and review.
If you are dire need of these features now, I
2017 Nov 05
2
calling va_arg functions on win32 seems to require explicit stack alignment?
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-pc-windows-msvc"
declare void @llvm.va_start(i8**)
declare void @llvm.va_end(i8**)
define i64 @foo(...) {
%va = alloca i8*, i32 16 ; 4 words should be enough?
call void @llvm.va_start(i8** %va)
%x = va_arg i8** %va, i64
call void @llvm.va_end(i8** %va)
ret i64 %x
}
2016 Jan 08
2
Is it a va_arg bug in clang?
For the variadic function error with AMD64 abi and windows calling convention on 64bits x86, I find it has been tracked in Bug 20847 (https://llvm.org/bugs/show_bug.cgi?id=20847) (http://reviews.llvm.org/D1622#inline-9345). Do we still plan to fix it?
You know, I meet exactly same va_arg mistake with llvm3.7 when I enable the Uefi firmware (http://www.uefi.org/) build with clang. The ms_abi is
2011 Aug 15
2
[LLVMdev] llc with -march=mips failed to compile va_start()/va_end()/va_arg()
Hi,
I am using llc (llvm 2.9) to generate the MIPS assembly, but failed
when compile any codes
with va_start()/va_end()/va_arg().
Here is the minimal step to reproduce the failure:
llvm-gcc-4.2 -emit-llvm hello.c -c -o hello.bc
llc -march=mips hello.bc -o hello.s
llc show this erroe message:
LLVM ERROR: Cannot select: 0xa1873a0: ch = vaend 0xa187290:1,
0xa185ae0, 0xa187318 [ID=38]
0xa185ae0:
2016 Jan 09
2
[cfe-dev] Is it a va_arg bug in clang?
Hi Richard,
Thank you for the info. I build my code in Ubuntu-64bits with simply commands: “clang X64.c”, then run “./a.out” to see the output. If I replace my va_list, va_start, va_arg va_end with __builtin_ms_va_list, __builtin_ms_va_start, __builtin_ms_va_arg, __builtin_ms_va_end, my code will build fail in Ubuntu with below message. Do you suggest I should build it in windows and not in
2014 Aug 26
2
[LLVMdev] [BUG] Varargs example in LangRef segfaults
Hi,
So the Variable Argument Handling Intrinsics section of the LangRef
(http://llvm.org/docs/LangRef.html#variable-argument-handling-intrinsics)
lists an example that segfaults. Try the following on x86_64:
-- 8< --
define i32 @test(i32 %X, ...) {
; Initialize variable argument processing
%ap = alloca i8*
%ap2 = bitcast i8** %ap to i8*
call void @llvm.va_start(i8* %ap2)
; Read a
2011 Aug 15
0
[LLVMdev] llc with -march=mips failed to compile va_start()/va_end()/va_arg()
On Mon, Aug 15, 2011 at 2:18 AM, Leo Chen. <leo.q.chen at gmail.com> wrote:
> Hi,
>
> I am using llc (llvm 2.9) to generate the MIPS assembly
I would suggest trying trunk; there have been a lot of improvements
recently to the MIPS backend.
-Eli
> but failed
> when compile any codes
> with va_start()/va_end()/va_arg().
>
> Here is the minimal step to reproduce the
2011 Aug 15
1
[LLVMdev] llc with -march=mips failed to compile va_start()/va_end()/va_arg()
On Aug 15, 2011, at 9:42 AM, Eli Friedman wrote:
> On Mon, Aug 15, 2011 at 2:18 AM, Leo Chen. <leo.q.chen at gmail.com> wrote:
>> Hi,
>>
>> I am using llc (llvm 2.9) to generate the MIPS assembly
>
> I would suggest trying trunk; there have been a lot of improvements
> recently to the MIPS backend.
>
I agree. Also, make sure you're using a MIPS
2013 Feb 27
2
[LLVMdev] Mips backend 3.2 va_arg possible bug
i have this code
typedef long long L;
typedef integer I;
void test2(auto L p0, auto L p1, auto L p2, auto L p4, ...)
{
va_list select;
va_start (select, p4);
report( va_arg(select,L) );
report( va_arg(select,I) );
report( va_arg(select,L) );
2013 Feb 19
2
[LLVMdev] Is va_arg correct on Mips backend?
I check the Mips backend for the following C code fragment compile result. It seems not correct. Is it my misunderstand or it's a bug.
//ch8_3.cpp
#include <stdarg.h>
int sum_i(int amount, ...)
{
int i = 0;
int val = 0;
int sum = 0;
va_list vl;
va_start(vl, amount);
for (i = 0; i < amount; i++)
{
val = va_arg(vl, int);
sum += val;
}
va_end(vl);
2006 Oct 05
3
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi,
Chris Lattner wrote:
> All the non-vastart calls can be anywhere. va_end in particular codegens
> to a noop on all targets llvm currently supports, fwiw.
>
Things go well, except for the following (pathological?) C program:
int va_double_sum(int count,...){
int i,sum=0;
va_list ap;
va_start(ap,count);
for(i=0;i<count;i++){
sum+=va_arg(ap,int);
}
va_end(ap);
2016 Apr 20
3
va_arg on Windows 64
Hi everyone,
I'm interested in variadic functions and how llvm handles them. I
discovered that the Clang frontend is doing a great job at lowering the
va_arg (precisely __builtin_va_arg) function into target dependent
code. I have also seen the va_arg function that exist at IR level.
I found some information about va_arg (IR one) that currently does not
support all platform. But since 2009,
2016 Jun 17
2
question about ARM 32 big endian
Hi everyone,
I have a question about ARM 32 big endian calling convention. It's about
sending small structures as function argument.
For example if passing 3 chars in a structure should alignment in
register (argument register for passing those chars in function) be
right-adjusted ?
LLVM (trunk version) is passing those chars left-adjusted in register,
and trying to read them like they
2015 Sep 28
4
varargs, the x86, and clang
When I use clang on an x86-64 to spit out the LLVM, like this
clang -O -S -emit-llvm varargstest.c
where varargstest.c looks like this
int add_em_up(int count, ...) {
va_list ap;
int i, sum;
va_start(ap, count);
sum = 0;
for (i = 0; i < count; i++)
sum += va_arg(ap, int);
va_end(ap);
return sum;
}
I see LLVM that looks like it's been customized for the x86-64,
versus
2013 Feb 19
0
[LLVMdev] Is va_arg correct on Mips backend?
Which part of the generated code do you think is not correct? Could you be
more specific?
I compiled this program with clang and ran it on a mips board. It returns
the expected result (21).
On Tue, Feb 19, 2013 at 4:15 AM, Jonathan <gamma_chen at yahoo.com.tw> wrote:
> I check the Mips backend for the following C code fragment compile result.
> It seems not correct. Is it my
2009 Aug 28
1
[LLVMdev] va_arg
I would like to be able to instrument va_arg, but when I generate a bc
file for a test case using:
llvm-gcc -O3 -emit-llvm vararg.c -c -o vararg.bc
I do not see va_arg. Instead, it seems the args are accessed through
%struct.__va_list_tag, which makes things a bit trickier to
instrument. Is there a way to force llvm-gcc to use va_arg?
Perhaps there is some documentation about va_list_tag or
2014 Oct 29
2
[LLVMdev] [PATCH] LangRef: va_arg doesn't work on X86_64; update example
Provide a full-fledged example of working variable arguments on X86_64,
since it's easily the most popular platform.
Cc: Reid Kleckner <rnk at google.com>
Signed-off-by: Ramkumar Ramachandra <artagnon at gmail.com>
---
docs/LangRef.rst | 44 ++++++++++++++++++++++++++++++--------------
1 file changed, 30 insertions(+), 14 deletions(-)
diff --git a/docs/LangRef.rst
2000 Jan 06
1
bsd-snprintf.c and NeXT.
I'm wonder if anyone happens to have a simplier (slower) version of
bsd-snprintf.c. It seems NeXT 3.3 (unsure about 4.2) is missing
mprotect().
If I could get something to replace that for a while and fix some of
theses utmp in login.c issues I may have a rough port NeXT to black
hardware.=)
Thanks
2006 Oct 03
2
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi,
Op 3-okt-06, om 20:48 heeft Chris Lattner het volgende geschreven:
> You'd have to change it to something like:
>
> void foo(int X, ...) {
> P = va_start();
> bar(X, P);
> }
>
> void bar(int X, valist P) {
> use(P);
> }
Can the other va_...-intrinsics be used in bar as were the "P =
va_start" in bar? The va_start probably is unnecessary
2006 Oct 03
0
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
On Tue, 3 Oct 2006, Bram Adams wrote:
>> You'd have to change it to something like:
>> void foo(int X, ...) {
>> P = va_start();
>> bar(X, P);
>> }
>>
>> void bar(int X, valist P) {
>> use(P);
>> }
>
> Can the other va_...-intrinsics be used in bar as were the "P =
> va_start" in bar? The va_start probably is