summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangUserExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Expression/ClangUserExpression.cpp')
-rw-r--r--lldb/source/Expression/ClangUserExpression.cpp32
1 files changed, 25 insertions, 7 deletions
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp
index c72c3b10d54..18f7a8daaa1 100644
--- a/lldb/source/Expression/ClangUserExpression.cpp
+++ b/lldb/source/Expression/ClangUserExpression.cpp
@@ -297,21 +297,19 @@ ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Error &err)
return;
}
- lldb::clang_type_t self_opaque_type = self_type->GetClangForwardType();
+ ClangASTType self_clang_type = self_type->GetClangForwardType();
- if (!self_opaque_type)
+ if (!self_clang_type)
{
err.SetErrorString(selfErrorString);
return;
}
-
- clang::QualType self_qual_type = clang::QualType::getFromOpaquePtr(self_opaque_type);
-
- if (self_qual_type->isObjCClassType())
+
+ if (self_clang_type.IsObjCClassType())
{
return;
}
- else if (self_qual_type->isObjCObjectPointerType())
+ else if (self_clang_type.IsObjCObjectPointerType())
{
m_objectivec = true;
m_needs_object_ptr = true;
@@ -487,6 +485,26 @@ ClangUserExpression::Parse (Stream &error_stream,
m_expr_decl_map.reset(new ClangExpressionDeclMap(keep_result_in_memory, exe_ctx));
+ class OnExit
+ {
+ public:
+ typedef std::function <void (void)> Callback;
+
+ OnExit (Callback const &callback) :
+ m_callback(callback)
+ {
+ }
+
+ ~OnExit ()
+ {
+ m_callback();
+ }
+ private:
+ Callback m_callback;
+ };
+
+ OnExit on_exit([this]() { m_expr_decl_map.reset(); });
+
if (!m_expr_decl_map->WillParse(exe_ctx, m_materializer_ap.get()))
{
error_stream.PutCString ("error: current process state is unsuitable for expression parsing\n");
OpenPOWER on IntegriCloud