[ORC] Render unresolved symbol addresses as "<not resolved>" in JITDylib::dump.
authorLang Hames <lhames@gmail.com>
Mon, 10 Sep 2018 22:09:11 +0000 (22:09 +0000)
committerLang Hames <lhames@gmail.com>
Mon, 10 Sep 2018 22:09:11 +0000 (22:09 +0000)
This is easier to spot among the real addresses than "0x0000000000000000".

llvm-svn: 341873

llvm/lib/ExecutionEngine/Orc/Core.cpp

index baee50e..1a1fd63 100644 (file)
@@ -1508,8 +1508,11 @@ void JITDylib::dump(raw_ostream &OS) {
        << "Symbol table:\n";
 
     for (auto &KV : Symbols) {
-      OS << "    \"" << *KV.first
-         << "\": " << format("0x%016x", KV.second.getAddress());
+      OS << "    \"" << *KV.first << "\": ";
+      if (auto Addr = KV.second.getAddress())
+        OS << format("0x%016x", Addr);
+      else
+        OS << "<not resolved>";
       if (KV.second.getFlags().isLazy() ||
           KV.second.getFlags().isMaterializing()) {
         OS << " (";