<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="generator" content="Osso Notes">
    <title></title></head>
<body>
<p>Hi Gordon,
<br>
<br>Yes, logically this is impossible. I'd reformulate the question in the following way: how could we change the argument type to be able to pass arrays of the various lengths without global variables? There is a variable length array type - maybe it can help somehow? Or could we create and initialize an AllocInst instead? So, any replacement for global vars would perfectly suite for our case.
<br>
<br>- D. 
<br>
<br>----- Original message -----
<br>> What memory would the pointer argument point to?
<br>> 
<br>> ― Gordon
<br>> 
<br>> On Nov 20, 2011, at 16:58, "Dmitry N. Mikushin" <<a href="mailto:maemarcus@gmail.com">maemarcus@gmail.com</a>>
<br>> wrote:
<br>> 
<br>> > Hi,
<br>> > 
<br>> > Is it possible to make up a ConstantArray containing a "const char*"
<br>> > string and pass it directly to the function "char*" argument *without*
<br>> > creating a GlobalVaribable?
<br>> > I looked around and found the usual implementation is
<br>> > array->globalVar->gep. If we omit globalVar & gep, then the argument
<br>> > type would be [ i8 x N ], where N is set to the exact string length,
<br>> > and the expected type is i8* => assertion.
<br>> > In other words, in C we can submit constant value directly to
<br>> > parameter list, e.g. foo("hello"). Is there an equivalent capability
<br>> > in LLVM IR?
<br>> > Our primary targets have limited support for global variables, and it
<br>> > is better to omit them, where possible.
<br>> > 
<br>> > Thanks,
<br>> > - Dima.
<br><br></p>
</body>
</html>