aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-02-08 00:29:29 +0000
committerZachary Turner <zturner@google.com>2015-02-08 00:29:29 +0000
commit21473f7bb613dd8e0fae47a5fb065e3d9a0da543 (patch)
tree6d66dac477be98ae8995405ff224116d4e05e60c /llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
parente169c57188b3d560c3a4cd843e8e87a80cbf3b1f (diff)
downloadllvm-21473f7bb613dd8e0fae47a5fb065e3d9a0da543.zip
llvm-21473f7bb613dd8e0fae47a5fb065e3d9a0da543.tar.gz
llvm-21473f7bb613dd8e0fae47a5fb065e3d9a0da543.tar.bz2
Some cleanup for libpdb.
This patch implements a few of the optional suggestions from the initial patch comitting libpdb. In particular, it implements a virtual function out of line for each of the concrete classes. A few other minor cleanups exist as well, such as using override instead of virtual, etc. llvm-svn: 228516
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
new file mode 100644
index 0000000..cf7dc80
--- /dev/null
+++ b/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
@@ -0,0 +1,45 @@
+//===- PDBSymbolExe.cpp - ---------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <utility>
+
+#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
+#include "llvm/Support/ConvertUTF.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/raw_ostream.h"
+
+#if defined(_WIN32)
+#include <windows.h>
+#endif
+
+using namespace llvm;
+
+namespace {
+std::string GuidToString(PDB_UniqueId *Id) {
+#if defined(_WIN32)
+ GUID *Guid = reinterpret_cast<GUID *>(Id);
+ OLECHAR GuidBuf[40];
+ int Result = StringFromGUID2(*Guid, GuidBuf, 39);
+ const char *InputBytes = reinterpret_cast<const char *>(GuidBuf);
+ std::string ResultString;
+ convertUTF16ToUTF8String(ArrayRef<char>(InputBytes, Result * 2),
+ ResultString);
+ return ResultString;
+#else
+ return std::string();
+#endif
+}
+}
+
+PDBSymbolExe::PDBSymbolExe(std::unique_ptr<IPDBRawSymbol> Symbol)
+ : PDBSymbol(std::move(Symbol)) {}
+
+void PDBSymbolExe::dump(llvm::raw_ostream &OS) const {
+}