summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorAaron Smith <aaron.smith@microsoft.com>2018-03-22 03:57:06 +0000
committerAaron Smith <aaron.smith@microsoft.com>2018-03-22 03:57:06 +0000
commit58a32a478f34a2809894d4c9ccf54d582d2416cc (patch)
treeded7e58b983090cb978b5652a3c9911e4b4adb0e /llvm/lib/DebugInfo
parentc8316ed266fcdb93bef30bcd931d2682365dc427 (diff)
downloadbcm5719-llvm-58a32a478f34a2809894d4c9ccf54d582d2416cc.tar.gz
bcm5719-llvm-58a32a478f34a2809894d4c9ccf54d582d2416cc.zip
[PDB] Get more DIA table enumerators
Rename the original function and make it a static template. llvm-svn: 328177
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp14
1 files changed, 8 insertions, 6 deletions
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<IPDBEnumTables> DIASession::getEnumTables() const {
return llvm::make_unique<DIAEnumTables>(DiaEnumerator);
}
-static CComPtr<IDiaEnumInjectedSources>
-getEnumInjectedSources(IDiaSession &Session) {
- CComPtr<IDiaEnumInjectedSources> EIS;
+template <class T>
+static CComPtr<T>
+getTableEnumerator(IDiaSession &Session) {
+ CComPtr<T> Enumerator;
CComPtr<IDiaEnumTables> ET;
CComPtr<IDiaTable> 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<IPDBEnumInjectedSources>
DIASession::getInjectedSources() const {
- CComPtr<IDiaEnumInjectedSources> Files = getEnumInjectedSources(*Session);
+ CComPtr<IDiaEnumInjectedSources> Files =
+ getTableEnumerator<IDiaEnumInjectedSources>(*Session);
if (!Files)
return nullptr;
OpenPOWER on IntegriCloud