From: Aaron Smith Date: Thu, 22 Mar 2018 03:57:06 +0000 (+0000) Subject: [PDB] Get more DIA table enumerators X-Git-Tag: llvmorg-7.0.0-rc1~9970 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58a32a478f34a2809894d4c9ccf54d582d2416cc;p=platform%2Fupstream%2Fllvm.git [PDB] Get more DIA table enumerators Rename the original function and make it a static template. llvm-svn: 328177 --- diff --git a/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp b/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp index 3a4ecdb..489184a 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;