aboutsummaryrefslogtreecommitdiffstats
path: root/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h')
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h b/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
index b39f89ad7eef..95e6c3ac963d 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
+++ b/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
@@ -45,11 +45,20 @@ public:
uint32_t addr_byte_size) override;
void RemovePersistentVariable(lldb::ExpressionVariableSP variable) override;
- llvm::StringRef
- GetPersistentVariablePrefix(bool is_error) const override {
+
+ llvm::StringRef GetPersistentVariablePrefix(bool is_error) const override {
return "$";
}
+ /// Returns the next file name that should be used for user expressions.
+ std::string GetNextExprFileName() {
+ std::string name;
+ name.append("<user expression ");
+ name.append(std::to_string(m_next_user_file_id++));
+ name.append(">");
+ return name;
+ }
+
llvm::Optional<CompilerType>
GetCompilerTypeFromPersistentDecl(ConstString type_name) override;
@@ -66,8 +75,10 @@ public:
}
private:
- uint32_t m_next_persistent_variable_id; ///< The counter used by
- ///GetNextResultName().
+ /// The counter used by GetNextExprFileName.
+ uint32_t m_next_user_file_id = 0;
+ // The counter used by GetNextPersistentVariableName
+ uint32_t m_next_persistent_variable_id = 0;
typedef llvm::DenseMap<const char *, clang::NamedDecl *> PersistentDeclMap;
PersistentDeclMap