Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Thiago Adams Newsgroups: comp.lang.c Subject: Re: transpiling to low level C Date: Wed, 18 Dec 2024 16:43:59 -0300 Organization: A noiseless patient Spider Lines: 17 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 18 Dec 2024 20:43:59 +0100 (CET) Injection-Info: dont-email.me; posting-host="0ecc45d771ee768cde30c5cfc52f49c4"; logging-data="2570111"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+U1TOG9bS6NcYH5UYd+h2jqdFddTgsiN0=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:u0MPAYIErCZ+hl1B3nurjwNiqMc= In-Reply-To: Content-Language: en-GB Bytes: 2068 Em 12/18/2024 3:51 PM, BGB escreveu: > > I took a different approach: > In the backend IR stage, structs are essentially treated as references > to the structure. > > A local structure may be "initialized" via an IR operation, in which > point it will be assigned storage in the stack frame, and the reference > will be initialized to the storage area for the structure. > > Most operations will pass them by reference. > > Assigning a struct will essentially be turned into a struct-copy > operation (using the same mechanism as inline memcpy). But what happens with calling a external C function that has a struct X as parameter? (not pointer to struct)