Exactly, the problem is that I also need a function that converts from Multibyte to UTF8. I added it to PathV2.inc with other conversion functions and then created a wrapper around it inside llvm::sys::path in order to call it inside ExpandArgv in driver.cpp. I know that this is not the right place for it, and it seems that I also need the one that converts from utf8 to utf16. The question is whether I should raise them (they are windows only functions) and if yes where do they belong?<br>

<br><div class="gmail_quote">On Wed, Aug 31, 2011 at 9:02 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Wed, Aug 31, 2011 at 1:17 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>> wrote:<br>
> On Wed, Aug 31, 2011 at 10:58 AM, Nikola Smiljanic <<a href="mailto:popizdeh@gmail.com">popizdeh@gmail.com</a>> wrote:<br>
>> _wopen expects wchar_t* and the only visible function for conversion to<br>
>> utf16 is ConvertUTF8toUTF32 which converts to unsigned shorts.<br>
><br>
> If you're in #ifdef WIN32 code, just use ConvertUTF8toUTF16 and<br>
> reinterpret_cast from unsigned short* to wchar_t*.<br>
<br>
</div>I think the problem is that PathV2.inc is part of LLVM, and the<br>
ConvertUTF8ToUTF16 function is in an anonymous namespace.  So the<br>
question becomes: raise the function into an accessible namespace,<br>
duplicate code, or find some other mechanism?<br>
<br>
I don't think it makes sense to raise the function out of the<br>
anonymous namespace unless it's also moved (it has nothing to do with<br>
paths per se).  Perhaps it's worth it to move it to StringRef?<br>
<font color="#888888"><br>
~Aaron<br>
</font></blockquote></div><br>