Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Store unresolved symbols in an unordered_set; have no need for ordering.
  • Loading branch information
marsupial authored and pcanal committed Aug 24, 2017
commit 508fb34cecc6225f988786e03926d0ed971c1318
9 changes: 4 additions & 5 deletions interpreter/cling/lib/Interpreter/IncrementalExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,18 +358,17 @@ bool IncrementalExecutor::diagnoseUnresolvedSymbols(llvm::StringRef trigger,
return false;

llvm::SmallVector<llvm::Function*, 128> funcsToFree;
for (std::set<std::string>::const_iterator i = m_unresolvedSymbols.begin(),
e = m_unresolvedSymbols.end(); i != e; ++i) {
for (const std::string& sym : m_unresolvedSymbols) {
#if 0
// FIXME: This causes a lot of test failures, for some reason it causes
// the call to HandleMissingFunction to be elided.
unsigned diagID = m_Diags.getCustomDiagID(clang::DiagnosticsEngine::Error,
"%0 unresolved while jitting %1");
(void)diagID;
//m_Diags.Report(diagID) << *i << funcname; // TODO: demangle the names.
//m_Diags.Report(diagID) << sym << funcname; // TODO: demangle the names.
#endif

cling::errs() << "IncrementalExecutor::executeFunction: symbol '" << *i
cling::errs() << "IncrementalExecutor::executeFunction: symbol '" << sym
<< "' unresolved while linking ";
if (trigger.find(utils::Synthesize::UniquePrefix) != llvm::StringRef::npos)
cling::errs() << "[cling interface function]";
Expand All @@ -383,7 +382,7 @@ bool IncrementalExecutor::diagnoseUnresolvedSymbols(llvm::StringRef trigger,
cling::errs() << "!\n";

// Be helpful, demangle!
std::string demangledName = platform::Demangle(*i);
std::string demangledName = platform::Demangle(sym);
if (!demangledName.empty()) {
cling::errs()
<< "You are probably missing the definition of "
Expand Down
4 changes: 2 additions & 2 deletions interpreter/cling/lib/Interpreter/IncrementalExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "llvm/ADT/StringRef.h"

#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <memory>
#include <atomic>
Expand Down Expand Up @@ -126,7 +126,7 @@ namespace cling {

///\brief Set of the symbols that the JIT couldn't resolve.
///
std::set<std::string> m_unresolvedSymbols;
std::unordered_set<std::string> m_unresolvedSymbols;

#if 0 // See FIXME in IncrementalExecutor.cpp
///\brief The diagnostics engine, printing out issues coming from the
Expand Down