Some cleanup for libpdb.
[oota-llvm.git] / lib / DebugInfo / PDB / PDBSymbolExe.cpp
1 //===- PDBSymbolExe.cpp - ---------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include <utility>
11
12 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
13 #include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
14 #include "llvm/Support/ConvertUTF.h"
15 #include "llvm/Support/FileSystem.h"
16 #include "llvm/Support/raw_ostream.h"
17
18 #if defined(_WIN32)
19 #include <windows.h>
20 #endif
21
22 using namespace llvm;
23
24 namespace {
25 std::string GuidToString(PDB_UniqueId *Id) {
26 #if defined(_WIN32)
27   GUID *Guid = reinterpret_cast<GUID *>(Id);
28   OLECHAR GuidBuf[40];
29   int Result = StringFromGUID2(*Guid, GuidBuf, 39);
30   const char *InputBytes = reinterpret_cast<const char *>(GuidBuf);
31   std::string ResultString;
32   convertUTF16ToUTF8String(ArrayRef<char>(InputBytes, Result * 2),
33                            ResultString);
34   return ResultString;
35 #else
36   return std::string();
37 #endif
38 }
39 }
40
41 PDBSymbolExe::PDBSymbolExe(std::unique_ptr<IPDBRawSymbol> Symbol)
42     : PDBSymbol(std::move(Symbol)) {}
43
44 void PDBSymbolExe::dump(llvm::raw_ostream &OS) const {
45 }