|
@@ -59,6 +59,7 @@
|
|
|
#include "llvm/Option/ArgList.h"
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
#include "llvm/Support/MemoryBuffer.h"
|
|
|
+#include "llvm/Support/Path.h"
|
|
|
#ifdef _WIN32
|
|
|
#include <dia2.h>
|
|
|
#include <comdef.h>
|
|
@@ -555,7 +556,12 @@ public:
|
|
|
_COM_Outptr_result_maybenull_ IDxcBlob **ppIncludeSource
|
|
|
) override {
|
|
|
try {
|
|
|
- *ppIncludeSource = includeFiles.at(std::wstring(pFilename));
|
|
|
+ // Convert pFilename into native form for indexing as is done when the MD is created
|
|
|
+ std::string FilenameStr8 = Unicode::UTF16ToUTF8StringOrThrow(pFilename);
|
|
|
+ llvm::SmallString<128> NormalizedPath;
|
|
|
+ llvm::sys::path::native(FilenameStr8, NormalizedPath);
|
|
|
+ std::wstring FilenameStr16 = Unicode::UTF8ToUTF16StringOrThrow(NormalizedPath.c_str());
|
|
|
+ *ppIncludeSource = includeFiles.at(FilenameStr16);
|
|
|
(*ppIncludeSource)->AddRef();
|
|
|
}
|
|
|
CATCH_CPP_RETURN_HRESULT()
|