[LLVMdev] request for windows unicode support

Jochen Wilhelmy j.wilhelmy at arcor.de
Fri Nov 26 09:13:57 PST 2010


>> I would think the most efficient approach is to use utf16 (i.e. wchar_t)
>> internally on windows
>> (ohterwise utf8). Then if a path is used multiple times no conversion takes
>> place. The conversion only
>> takes place at creation time when you create a path from utf8.
>>      
> The current API is stateless, meaning that the user is responsible for
> the storage and format of paths. Thus there is no internal storage.
> However, we could cache the conversion using a thread local limited
> size LRU cache depending on how long the conversion takes. Storing
> string as utf-16 would require changing them to utf-8 whenever the
> client wanted to look at them, incurring lots of memory allocations
> and copying.
>    
but for llvm an implementation of your API has to be provided?
As the conversion problem only exists on windows I would not try to 
optimize it and I doubt it
will be a performance bottleneck. And as you don't use the boost path my 
only wish is that
passing a boost path should be easy, e.g. by allowing const wchar_t* on 
windows.
Therefore utf-8 as internal format should be ok too.

-Jochen




More information about the llvm-dev mailing list