//
//===----------------------------------------------------------------------===//
-#include <type_traits>
#include <unordered_map>
+#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"
#include "gtest/gtest.h"
using namespace llvm;
-namespace std {
- template<>
- struct hash<PDB_SymType> {
- public:
- std::size_t operator()(PDB_SymType Symbol) const {
- return std::hash<int>()(static_cast<int>(Symbol));
- }
- };
-}
-
namespace {
#define MOCK_SYMBOL_ACCESSOR(Func) \
getSourceFileById(uint32_t SymbolId) const override {
return nullptr;
}
+
+ std::unique_ptr<PDBSymbol>
+ findSymbolByAddress(uint64_t Address, PDB_SymType Type) const override {
+ return nullptr;
+ }
+ std::unique_ptr<IPDBEnumLineNumbers>
+ findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override {
+ return nullptr;
+ }
+
+ std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override {
+ return nullptr;
+ }
+ std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
+ const PDBSymbolCompiland &Compiland) const override {
+ return nullptr;
+ }
+
std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override {
return nullptr;
}
class MockRawSymbol : public IPDBRawSymbol {
public:
- MockRawSymbol(PDB_SymType SymType) : Type(SymType) {}
+ MockRawSymbol(PDB_SymType SymType)
+ : Type(SymType) {}
- void dump(llvm::raw_ostream &OS) const override {}
+ void dump(raw_ostream &OS, int Indent) const override {}
+ std::unique_ptr<IPDBEnumSymbols>
+ findChildren(PDB_SymType Type) const override {
+ return nullptr;
+ }
std::unique_ptr<IPDBEnumSymbols>
findChildren(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags) const override {
MOCK_SYMBOL_ACCESSOR(hasDebugInfo)
MOCK_SYMBOL_ACCESSOR(hasEH)
MOCK_SYMBOL_ACCESSOR(hasEHa)
+ MOCK_SYMBOL_ACCESSOR(hasFramePointer)
MOCK_SYMBOL_ACCESSOR(hasInlAsm)
MOCK_SYMBOL_ACCESSOR(hasInlineAttribute)
MOCK_SYMBOL_ACCESSOR(hasInterruptReturn)
MOCK_SYMBOL_ACCESSOR(isVirtualBaseClass)
MOCK_SYMBOL_ACCESSOR(isVirtualInheritance)
MOCK_SYMBOL_ACCESSOR(isVolatileType)
+ MOCK_SYMBOL_ACCESSOR(getValue)
+ MOCK_SYMBOL_ACCESSOR(wasInlined)
+ MOCK_SYMBOL_ACCESSOR(getUnused)
private:
PDB_SymType Type;
std::unique_ptr<IPDBSession> Session;
void InsertItemWithTag(PDB_SymType Tag) {
- auto RawSymbol = std::unique_ptr<IPDBRawSymbol>(new MockRawSymbol(Tag));
+ auto RawSymbol = llvm::make_unique<MockRawSymbol>(Tag);
auto Symbol = PDBSymbol::create(*Session, std::move(RawSymbol));
SymbolMap.insert(std::make_pair(Tag, std::move(Symbol)));
}