Zachary Turner | 0e9e663 | 2015-02-06 20:30:52 +0000 | [diff] [blame] | 1 | //===- PDB.cpp - base header file for creating a PDB reader -----*- 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 | |
Zachary Turner | cffff26 | 2015-02-10 21:17:52 +0000 | [diff] [blame^] | 10 | #include "llvm/Config/config.h" |
| 11 | |
Zachary Turner | 0e9e663 | 2015-02-06 20:30:52 +0000 | [diff] [blame] | 12 | #include "llvm/ADT/StringRef.h" |
| 13 | |
| 14 | #include "llvm/DebugInfo/PDB/PDB.h" |
| 15 | #include "llvm/DebugInfo/PDB/IPDBSession.h" |
Zachary Turner | cffff26 | 2015-02-10 21:17:52 +0000 | [diff] [blame^] | 16 | #if HAVE_DIA_SDK |
| 17 | #include "llvm/DebugInfo/PDB/DIA/DIASession.h" |
| 18 | #endif |
Zachary Turner | 0e9e663 | 2015-02-06 20:30:52 +0000 | [diff] [blame] | 19 | |
| 20 | using namespace llvm; |
| 21 | |
| 22 | std::unique_ptr<IPDBSession> llvm::createPDBReader(PDB_ReaderType Type, |
| 23 | StringRef Path) { |
| 24 | // Create the correct concrete instance type based on the value of Type. |
Zachary Turner | cffff26 | 2015-02-10 21:17:52 +0000 | [diff] [blame^] | 25 | #if HAVE_DIA_SDK |
| 26 | return std::unique_ptr<DIASession>(DIASession::createFromPdb(Path)); |
| 27 | #endif |
Zachary Turner | 0e9e663 | 2015-02-06 20:30:52 +0000 | [diff] [blame] | 28 | return nullptr; |
| 29 | } |