summaryrefslogtreecommitdiffstats
path: root/lldb/include/lldb/Expression/ClangExpressionVariable.h
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/include/lldb/Expression/ClangExpressionVariable.h')
-rw-r--r--lldb/include/lldb/Expression/ClangExpressionVariable.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/lldb/include/lldb/Expression/ClangExpressionVariable.h b/lldb/include/lldb/Expression/ClangExpressionVariable.h
index 5c3377f80e1..a1586cef07f 100644
--- a/lldb/include/lldb/Expression/ClangExpressionVariable.h
+++ b/lldb/include/lldb/Expression/ClangExpressionVariable.h
@@ -89,6 +89,7 @@ struct ClangExpressionVariable
TypeFromParser m_parser_type; ///< The type of the variable according to the parser
const clang::NamedDecl *m_named_decl; ///< The Decl corresponding to this variable
llvm::Value *m_llvm_value; ///< The IR value corresponding to this variable; usually a GlobalValue
+ lldb_private::Value *m_lldb_value; ///< The value found in LLDB for this variable
};
std::auto_ptr<ParserVars> m_parser_vars;
@@ -250,6 +251,27 @@ public:
}
return NULL;
}
+
+ //----------------------------------------------------------------------
+ /// Finds a variable by NamedDecl in the list.
+ ///
+ /// @param[in] name
+ /// The name of the requested variable.
+ ///
+ /// @return
+ /// The variable requested, or NULL if that variable is not in the list.
+ //----------------------------------------------------------------------
+ ClangExpressionVariable *GetVariable (const clang::NamedDecl *decl)
+ {
+ for (uint64_t index = 0, size = Size(); index < size; ++index)
+ {
+ ClangExpressionVariable &candidate (VariableAtIndex(index));
+ if (candidate.m_parser_vars.get() &&
+ candidate.m_parser_vars->m_named_decl == decl)
+ return &candidate;
+ }
+ return NULL;
+ }
};
//----------------------------------------------------------------------
OpenPOWER on IntegriCloud