Skip to content

Commit 94bbc18

Browse files
committed
[ORC] Add some debug logging to EPCDynamicLibrarySearchGenerator.
Coding my way home: 8.98112N, 79.52094W
1 parent c15218b commit 94bbc18

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

llvm/lib/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
10+
#include "llvm/ExecutionEngine/Orc/DebugUtils.h"
1011
#include "llvm/Support/Error.h"
1112

13+
#define DEBUG_TYPE "orc"
14+
1215
namespace llvm {
1316
namespace orc {
1417

@@ -31,6 +34,11 @@ Error EPCDynamicLibrarySearchGenerator::tryToGenerate(
3134
if (Symbols.empty())
3235
return Error::success();
3336

37+
LLVM_DEBUG({
38+
dbgs() << "EPCDynamicLibrarySearchGenerator trying to generate "
39+
<< Symbols << "\n";
40+
});
41+
3442
SymbolLookupSet LookupSymbols;
3543

3644
for (auto &KV : Symbols) {
@@ -44,8 +52,12 @@ Error EPCDynamicLibrarySearchGenerator::tryToGenerate(
4452
// Copy-capture LookupSymbols, since LookupRequest keeps a reference.
4553
EPC.lookupSymbolsAsync(Request, [this, &JD, LS = std::move(LS),
4654
LookupSymbols](auto Result) mutable {
47-
if (!Result)
55+
if (!Result) {
56+
LLVM_DEBUG({
57+
dbgs() << "EPCDynamicLibrarySearchGenerator lookup failed due to error";
58+
});
4859
return LS.continueLookup(Result.takeError());
60+
}
4961

5062
assert(Result->size() == 1 && "Results for more than one library returned");
5163
assert(Result->front().size() == LookupSymbols.size() &&
@@ -59,6 +71,11 @@ Error EPCDynamicLibrarySearchGenerator::tryToGenerate(
5971
++ResultI;
6072
}
6173

74+
LLVM_DEBUG({
75+
dbgs() << "EPCDynamicLibrarySearchGenerator lookup returned "
76+
<< NewSymbols << "\n";
77+
});
78+
6279
// If there were no resolved symbols bail out.
6380
if (NewSymbols.empty())
6481
return LS.continueLookup(Error::success());

0 commit comments

Comments
 (0)