This is an archive of the discontinued LLVM Phabricator instance.

Move the persistent variable counter into Target
ClosedPublic

Authored by aprantl on Apr 25 2018, 2:15 PM.

Details

Summary

Move the persistent variable counter into Target so it can be shared across multiple language plugins.

In a multi-language project it is counterintuitive to have a result
variables reuse numbers just because they are using a different
language plugin in LLDB (but not for example, when they are
Objective-C versus C++, since they are both handled by Clang).

This is NFC on llvm.org except for the Go plugin.

rdar://problem/39299889

Diff Detail

Repository
rL LLVM

Event Timeline

aprantl created this revision.Apr 25 2018, 2:15 PM
aprantl updated this revision to Diff 144628.Apr 30 2018, 1:38 PM

Thread an is_error flag through for plugins that need it.

jingham requested changes to this revision.Apr 30 2018, 3:28 PM

Except for the inline comment, this is okay. If we thought hard we might find another likely reason why we'd want to use two result prefixes besides a language that has an error return side-channel. But I can't off the top of my head, so is_error is fine for now.

This revision now requires changes to proceed.Apr 30 2018, 3:28 PM

I'm sorry: which inline comment? Did you perhaps forget to hit "Submit"?

Eh, must have. The page really shouldn't let you overall submit if there are uncommitted comments, but whatever. Let's see if I did it right this time..

source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
668 ↗(On Diff #144628)

Don't hard-code "$" here, call GetPersistentVariablePrefix.

This revision was not accepted when it landed; it landed in state Needs Revision.Apr 30 2018, 5:02 PM
This revision was automatically updated to reflect the committed changes.