pp-many-files, v3
    Don't drop a preprocessor defines when tcc going to preprocess a next
    file in the same pass like
        tcc -E one.c two.c three.c -o combined.i
    This will allow to speed up a compilation process by using a commamd like
        tcc -E *.c | tcc -o program.exe -xc -

    It looks that multi-times initialization don't affect anything.
    Only call to the free_defines(define_start) in tcc_preprocess()
    is removed in assumption that free_defines(NULL) in
    tcc_cleanup() will free all defines.

2015-01-06 15:33 GMT+03:00, Sergey Korshunoff <[email protected]>:
> I forgot to attach a patch
>
> 2015-01-06 15:29 GMT+03:00, Sergey Korshunoff <[email protected]>:
>> pp-many-files, v2
>> Don't drop a preprocessor defines when tcc going to preprocess a next
>> file in the same pass like "tcc -E one.c two.c three.c -o combined.i"
>> This will allow to speed up a compilation process by using a commamd like
>>         tcc -E *.c | tcc -o program.exe -xc -
>>
>> Initialization from tcc_preprocess() is moved to tcc_add_file_internal().
>> Call to free_defines(define_start) in tcc_preprocess()  is removed in
>> assumption
>> that free_defines(NULL) in  tcc_cleanup() will free all defines.
>>
>>
>> 2015-01-04 1:46 GMT+03:00, Thomas Preud'homme <[email protected]>:
>>> Le samedi 27 décembre 2014, 16:19:04 Sergey Korshunoff a écrit :
>>>> Don't drop a preprocessor defines when tcc going to preprocess a next
>>>> file in the same pass like
>>>>         tcc -E one.c two.c three.c -o combined.i
>>>>
>>>> Currently tcc don't handle such case. The new behavior is better then
>>>> the current one. After a patch it is possible to compile combined.i
>>>> in case:
>>>>
>>>> * include files are properly protected by
>>>>         #ifndef MY_INCLUDE_H
>>>>         #define MY_INCLUDE_H
>>>>           extern void func();
>>>>         #endif
>>>> * there is no incompatible declarations for the same name in *.c
>>>>
>>>> An archive for a test purpose is included
>>>
>>> Sorry but I'm not sure I like this functionality. When gcc compiles
>>> several
>>> .c
>>> files they are compiled independently: macro are not kept accross files.
>>> Doing
>>> this only for -E flag would make it not very consistent. Also I don't
>>> like
>>> the
>>> shape of the patch: initialization of the preprocessing should be split
>>> out
>>> of
>>> the function but anyway that is not worth discussing further given
>>> previous
>>>
>>> point.
>>>
>>> Best regards,
>>>
>>> Thomas
>>>
>>
>

Attachment: 2014-12-27-02-pp-many-files.patch
Description: Binary data

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to