[llvm-dev] Sharing MemoryBuffers between front ends and LLVM
Hal Finkel via llvm-dev
llvm-dev at lists.llvm.org
Thu Mar 16 17:44:14 PDT 2017
On 03/16/2017 07:36 PM, Mehdi Amini wrote:
>
>> On Mar 16, 2017, at 5:27 PM, Hal Finkel <hfinkel at anl.gov
>> <mailto:hfinkel at anl.gov>> wrote:
>>
>>
>> On 03/16/2017 06:22 PM, Mehdi Amini via llvm-dev wrote:
>>>> On Mar 16, 2017, at 10:29 AM, Roger Ferrer Ibanez via llvm-dev
>>>> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I'm implementing interleaved source in assembly output. Early
>>>> reviews raised the concern
>>> Is there a patch up for review?
>>
>> https://reviews.llvm.org/D30898
>> https://reviews.llvm.org/D30897
>>
>>> I’m wondering how is the frontend enabling this interleaved output mode?
>>
>> I'm not sure this has been really discussed in the review yet
>> (although there certainly is a proposed mechanism in the patches).
>
> I wonder if the most straightforward way isn’t to leave the
> memorybuffer initialization up to the client, at the same place where
> the setting is (currently MCTargetOptions, not sure if it is the right
> place).
>
> To enable the ASMSource option, client would have to call something
> like `MCTargetOptions::setAsmInterleavedSourceCode( Mode, Buffer);
I think you'd still need a callback, although you could certainly set it
this way too. The problem is that you potentially need buffers
corresponding to all files included by the main source file, not just
the main source file itself. You wouldn't want to open them all ahead of
time either because, besides being wasteful, you might run out of file
handles).
-Hal
>
> —
> Mehdi
>
--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170316/979563e1/attachment.html>
More information about the llvm-dev
mailing list