Hi Argyrios,

On Mon, Nov 5, 2012 at 10:08 PM, Argyrios Kyrtzidis <[email protected]>wrote:

> On Nov 5, 2012, at 12:05 PM, Kim Gräsman <[email protected]> wrote:
>
> On Mon, Nov 5, 2012 at 8:50 PM, Douglas Gregor <[email protected]> wrote:
>
>>
>> On Nov 5, 2012, at 11:44 AM, Argyrios Kyrtzidis <[email protected]>
>> wrote:
>>
>> > Could we change the Preprocessor to accept an optional pointer to a
>> ModuleLoader ?
>>
>
> Since Preprocessor has a getModuleLoader() method, that would force
> null-checks on all callers. Currently only 2 of them, so no big deal, but I
> tend to shy away from exposing NULLs.
>
>
> How about if you don't pass an implementation of ModuleLoader, the
> preprocessor creates internally the "VoidModuleLoader".
>

I tried two more variations;

- OptionalModuleLoader.patch -- what you suggested above. Needs a flag and
dynamic allocation and lots of point changes to go from ref to pointer.
- ImpureModuleLoader.patch -- what I suggested later; have ModuleLoader not
be a protocol class, but give loadModule a default implementation. I don't
know if it's important for ModuleLoader to be pure.

For what it's worth,
- Kim

Attachment: ImpureModuleLoader.patch
Description: Binary data

Attachment: OptionalModuleLoader.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to