PDB.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #include "llvm/DebugInfo/PDB/PDB.h"
  10. #include "llvm/ADT/StringRef.h"
  11. #include "llvm/Config/config.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. using namespace llvm;
  18. PDB_ErrorCode llvm::loadDataForPDB(PDB_ReaderType Type, StringRef Path,
  19. std::unique_ptr<IPDBSession> &Session) {
  20. // Create the correct concrete instance type based on the value of Type.
  21. #if HAVE_DIA_SDK
  22. return DIASession::createFromPdb(Path, Session);
  23. #endif
  24. return PDB_ErrorCode::NoPdbImpl;
  25. }
  26. PDB_ErrorCode llvm::loadDataForEXE(PDB_ReaderType Type, StringRef Path,
  27. std::unique_ptr<IPDBSession> &Session) {
  28. // Create the correct concrete instance type based on the value of Type.
  29. #if HAVE_DIA_SDK
  30. return DIASession::createFromExe(Path, Session);
  31. #endif
  32. return PDB_ErrorCode::NoPdbImpl;
  33. }