[Lldb-commits] [PATCH] D46088: Refactor GetNextPersistentVariableName into a non-virtual method

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 27 17:17:56 PDT 2018


jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

I'm curious how you are going to implement GetPersistentVariablePrefix for a language (e.g. swift) that uses multiple prefixes.  You've got a pattern here where you always call GetPersistentVariablePrefix, but you're going to have to break that pattern for swift.  And then how are you going to handle that in generic code w/o having to check the language.

Anyway, you shouldn't hardcode $ twice.



================
Comment at: source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp:672
 ConstString ClangUserExpression::ResultDelegate::GetName() {
-  return m_persistent_state->GetNextPersistentVariableName(*m_target_sp);
+  return m_persistent_state->GetNextPersistentVariableName(*m_target_sp, "$");
 }
----------------
Was it just an oversight that you don't call m_persistent_state->GetPersistentVariablePrefix here?



https://reviews.llvm.org/D46088





More information about the lldb-commits mailing list