<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Reid,<br>
<br>
Thanks for the reply!<br>
<br>
So the basic solution you are proposing here is to cross-compile the
codes to another fake target that doesn't do anything fancy for
varargs, right? But if I change the target, will I be able to
compile my programs using the native libc headers on my machine
(they might get messed up by the #ifdefs)? I would imagine that I'll
face all the nasty issues related to cross compilation, which
doesn't seems to be simpler to tackle than the vararg problem.<br>
<br>
<div class="moz-cite-prefix">On 07/20/2015 11:05 AM, Reid Kleckner
wrote:<br>
</div>
<blockquote
cite="mid:CACs=tyJFaZ8XgzviAcUygHf0VAjsPrwKM4Yq_NrTQtshG1i_Rg@mail.gmail.com"
type="cite">
<div dir="ltr">Someone else (possibly from your research group!)
wanted something similar a long time ago. They wanted a way to
ensure that structs were always passed in memory using the
'byval' attribute, so that they could more easily analyze the
IR. The proposed solution was to add a target triple and then
compile targeting that. Unfortunately, they didn't get any
traction, so we never added that. That solution also has the
downside that you'll miss code under architecture specific
#ifdefs that you might want to analyze.
<div><br>
</div>
<div>Anyway, I can't actually find the relevant email anymore,
but searching "llvmdev defaultabiinfo" turns up a bunch of
relevant hits for you.</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sun, Jul 19, 2015 at 12:43 PM, Jia
Chen <span dir="ltr"><<a moz-do-not-send="true" href="mailto:jchen@cs.utexas.edu" target="_blank">jchen@cs.utexas.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi clang
devs,<br>
<br>
I've been writing static analysis on top of LLVM IR for
quite some time and I rely on clang to get me IRs from C
source codes. Functions with variadic arguments used to be
something I tried to avoid but as my work progressed, it
seems that a lot of real-world C codes use them so it's
necessary to teach my analysis to understand them.<br>
<br>
If my understanding was correct, currently clang recognizes
variadic functions in C source code and directly emit IRs
that manipulate architecture-specific vararg structures,
rather than emitting a target-independent va_arg
instruction. At least on my x86_64 machine, this vararg
structure consists of two offset fields and two buffer
pointers and is quite difficult to handle. It would be nice
if the front end could stop the vararg lowering and just
give me a simple va_arg instruction instead. Is there a
simple tweak I can do to have clang give me the va_arg
instruction I want? Or do I have to modify clang's source
code to do that?<br>
<br>
-- <br>
Best Regards,<br>
<br>
--<br>
Jia Chen<br>
Department of Computer Science<br>
University of Texas at Austin<br>
<a moz-do-not-send="true" href="mailto:jchen@cs.utexas.edu" target="_blank">jchen@cs.utexas.edu</a><br>
<a moz-do-not-send="true" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.utexas.edu_-257Ejchen&d=AwMCaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=oHc_Pscx8I1IdpRd6VV90VkkzwyJqaF5EB540fnSH60&s=l6VpRef535DhPJRIHSCKi1Slm0XGwuMfkfQrsBFVue4&e=" rel="noreferrer" target="_blank">http://www.cs.utexas.edu/~jchen</a><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a moz-do-not-send="true" href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Best Regards,
--
Jia Chen
Department of Computer Science
University of Texas at Austin
<a class="moz-txt-link-abbreviated" href="mailto:jchen@cs.utexas.edu">jchen@cs.utexas.edu</a>
<a class="moz-txt-link-freetext" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.utexas.edu_-7Ejchen&d=AwMCaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=oHc_Pscx8I1IdpRd6VV90VkkzwyJqaF5EB540fnSH60&s=aVz0pZRSi3572H4LmhzrR9fCkepFCYzVsnghKi4U_4Q&e=">http://www.cs.utexas.edu/~jchen</a></pre>
</body>
</html>