2015-02-07 04:30:52 +08:00
|
|
|
//===- PDB.cpp - base header file for creating a PDB reader -----*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2015-02-14 11:53:56 +08:00
|
|
|
#include "llvm/DebugInfo/PDB/PDB.h"
|
|
|
|
|
2015-02-07 04:30:52 +08:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2015-02-14 11:53:56 +08:00
|
|
|
#include "llvm/Config/config.h"
|
2015-02-07 04:30:52 +08:00
|
|
|
#include "llvm/DebugInfo/PDB/IPDBSession.h"
|
2015-02-13 17:09:03 +08:00
|
|
|
#include "llvm/DebugInfo/PDB/PDB.h"
|
2015-02-14 11:53:56 +08:00
|
|
|
|
2015-02-11 05:17:52 +08:00
|
|
|
#if HAVE_DIA_SDK
|
|
|
|
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
|
|
|
|
#endif
|
2015-02-07 04:30:52 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
std::unique_ptr<IPDBSession> llvm::createPDBReader(PDB_ReaderType Type,
|
|
|
|
StringRef Path) {
|
|
|
|
// Create the correct concrete instance type based on the value of Type.
|
2015-02-11 05:17:52 +08:00
|
|
|
#if HAVE_DIA_SDK
|
|
|
|
return std::unique_ptr<DIASession>(DIASession::createFromPdb(Path));
|
|
|
|
#endif
|
2015-02-07 04:30:52 +08:00
|
|
|
return nullptr;
|
|
|
|
}
|