From 58a32a478f34a2809894d4c9ccf54d582d2416cc Mon Sep 17 00:00:00 2001 From: Aaron Smith Date: Thu, 22 Mar 2018 03:57:06 +0000 Subject: [PDB] Get more DIA table enumerators Rename the original function and make it a static template. llvm-svn: 328177 --- llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'llvm/lib/DebugInfo') diff --git a/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp b/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp index 3a4ecdba6b1..489184ae7fc 100644 --- a/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp +++ b/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp @@ -327,9 +327,10 @@ std::unique_ptr DIASession::getEnumTables() const { return llvm::make_unique(DiaEnumerator); } -static CComPtr -getEnumInjectedSources(IDiaSession &Session) { - CComPtr EIS; +template +static CComPtr +getTableEnumerator(IDiaSession &Session) { + CComPtr Enumerator; CComPtr ET; CComPtr Table; ULONG Count = 0; @@ -340,15 +341,16 @@ getEnumInjectedSources(IDiaSession &Session) { while (ET->Next(1, &Table, &Count) == S_OK && Count == 1) { // There is only one table that matches the given iid if (S_OK == - Table->QueryInterface(__uuidof(IDiaEnumInjectedSources), (void **)&EIS)) + Table->QueryInterface(__uuidof(T), (void **)&Enumerator)) break; Table.Release(); } - return EIS; + return Enumerator; } std::unique_ptr DIASession::getInjectedSources() const { - CComPtr Files = getEnumInjectedSources(*Session); + CComPtr Files = + getTableEnumerator(*Session); if (!Files) return nullptr; -- cgit v1.2.3