1 //===- DIAUtils.h - Utility functions for working with DIA ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_DIA_DIAUTILS_H
11 #define LLVM_DEBUGINFO_PDB_DIA_DIAUTILS_H
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/Support/ConvertUTF.h"
16 template <typename Obj>
17 std::string invokeBstrMethod(Obj &Object,
18 HRESULT (__stdcall Obj::*Func)(BSTR *)) {
20 HRESULT Result = (Object.*Func)(&Str16);
25 llvm::ArrayRef<char> StrBytes(reinterpret_cast<char *>(Str16.m_str),
27 llvm::convertUTF16ToUTF8String(StrBytes, Str8);
31 #endif // LLVM_DEBUGINFO_PDB_DIA_DIAUTILS_H