Skip to content

Commit fa5df84

Browse files
committed
Avoid allocating std::strings when calling m_Executor->addSymbol.
1 parent 560819d commit fa5df84

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Interpreter/Interpreter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ namespace cling {
269269
#endif
270270
if (GV) {
271271
if (void* Addr = m_Executor->getPointerToGlobalFromJIT(*GV))
272-
m_Executor->addSymbol(Sym.str().c_str(), Addr, true);
272+
m_Executor->addSymbol(Sym, Addr, true);
273273
else
274274
cling::errs() << Sym << " not defined\n";
275275
} else
@@ -296,9 +296,9 @@ namespace cling {
296296
#endif
297297
// gCling gets linked to top-most Interpreter.
298298
if (!parent())
299-
m_Executor->addSymbol(Name.c_str(), &m_Parenting, true);
299+
m_Executor->addSymbol(Name, &m_Parenting, true);
300300
else
301-
m_Executor->addSymbol(Name.c_str(), &m_Parenting[1], true);
301+
m_Executor->addSymbol(Name, &m_Parenting[1], true);
302302
}
303303
} else {
304304
cling::errs() << "gCling was not found\n";

0 commit comments

Comments
 (0)