7
7
// ===----------------------------------------------------------------------===//
8
8
9
9
#include " llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
10
+ #include " llvm/ExecutionEngine/Orc/DebugUtils.h"
10
11
#include " llvm/Support/Error.h"
11
12
13
+ #define DEBUG_TYPE " orc"
14
+
12
15
namespace llvm {
13
16
namespace orc {
14
17
@@ -31,6 +34,11 @@ Error EPCDynamicLibrarySearchGenerator::tryToGenerate(
31
34
if (Symbols.empty ())
32
35
return Error::success ();
33
36
37
+ LLVM_DEBUG ({
38
+ dbgs () << " EPCDynamicLibrarySearchGenerator trying to generate "
39
+ << Symbols << " \n " ;
40
+ });
41
+
34
42
SymbolLookupSet LookupSymbols;
35
43
36
44
for (auto &KV : Symbols) {
@@ -44,8 +52,12 @@ Error EPCDynamicLibrarySearchGenerator::tryToGenerate(
44
52
// Copy-capture LookupSymbols, since LookupRequest keeps a reference.
45
53
EPC.lookupSymbolsAsync (Request, [this , &JD, LS = std::move (LS),
46
54
LookupSymbols](auto Result) mutable {
47
- if (!Result)
55
+ if (!Result) {
56
+ LLVM_DEBUG ({
57
+ dbgs () << " EPCDynamicLibrarySearchGenerator lookup failed due to error" ;
58
+ });
48
59
return LS.continueLookup (Result.takeError ());
60
+ }
49
61
50
62
assert (Result->size () == 1 && " Results for more than one library returned" );
51
63
assert (Result->front ().size () == LookupSymbols.size () &&
@@ -59,6 +71,11 @@ Error EPCDynamicLibrarySearchGenerator::tryToGenerate(
59
71
++ResultI;
60
72
}
61
73
74
+ LLVM_DEBUG ({
75
+ dbgs () << " EPCDynamicLibrarySearchGenerator lookup returned "
76
+ << NewSymbols << " \n " ;
77
+ });
78
+
62
79
// If there were no resolved symbols bail out.
63
80
if (NewSymbols.empty ())
64
81
return LS.continueLookup (Error::success ());
0 commit comments