Re-sort #include lines using my handy dandy ./utils/sort_includes.py
[oota-llvm.git] / lib / DebugInfo / PDB / PDB.cpp
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
10 #include "llvm/Config/config.h"
11 #include "llvm/ADT/StringRef.h"
12 #include "llvm/DebugInfo/PDB/IPDBSession.h"
13 #include "llvm/DebugInfo/PDB/PDB.h"
14 #if HAVE_DIA_SDK
15 #include "llvm/DebugInfo/PDB/DIA/DIASession.h"
16 #endif
17
18 using namespace llvm;
19
20 std::unique_ptr<IPDBSession> llvm::createPDBReader(PDB_ReaderType Type,
21                                                    StringRef Path) {
22   // Create the correct concrete instance type based on the value of Type.
23 #if HAVE_DIA_SDK
24   return std::unique_ptr<DIASession>(DIASession::createFromPdb(Path));
25 #endif
26   return nullptr;
27 }