2015-02-06 20:30:52 +00: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 03:53:56 +00:00
|
|
|
#include "llvm/DebugInfo/PDB/PDB.h"
|
|
|
|
|
2015-02-06 20:30:52 +00:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2015-02-14 03:53:56 +00:00
|
|
|
#include "llvm/Config/config.h"
|
2015-02-06 20:30:52 +00:00
|
|
|
#include "llvm/DebugInfo/PDB/IPDBSession.h"
|
2015-02-13 09:09:03 +00:00
|
|
|
#include "llvm/DebugInfo/PDB/PDB.h"
|
2015-02-14 03:53:56 +00:00
|
|
|
|
2015-02-10 21:17:52 +00:00
|
|
|
#if HAVE_DIA_SDK
|
|
|
|
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
|
|
|
|
#endif
|
2015-02-06 20:30:52 +00:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2015-02-28 20:23:18 +00:00
|
|
|
PDB_ErrorCode llvm::createPDBReader(PDB_ReaderType Type, StringRef Path,
|
|
|
|
std::unique_ptr<IPDBSession> &Session) {
|
2015-02-06 20:30:52 +00:00
|
|
|
// Create the correct concrete instance type based on the value of Type.
|
2015-02-10 21:17:52 +00:00
|
|
|
#if HAVE_DIA_SDK
|
2015-02-28 20:23:18 +00:00
|
|
|
return DIASession::createFromPdb(Path, Session);
|
2015-02-10 21:17:52 +00:00
|
|
|
#endif
|
2015-02-28 20:23:18 +00:00
|
|
|
return PDB_ErrorCode::NoPdbImpl;
|
2015-02-06 20:30:52 +00:00
|
|
|
}
|