summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2015-09-15 21:13:50 +0000
committerJim Ingham <jingham@apple.com>2015-09-15 21:13:50 +0000
commit151c032c86aa7de4244a9ed52d420ecb09550d0b (patch)
tree44f8d890499ac2e99bb2a4fd50975f7c986d72a8 /lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h
parent01fa3f96b37499e43d0d26b46151268b1b891342 (diff)
downloadbcm5719-llvm-151c032c86aa7de4244a9ed52d420ecb09550d0b.tar.gz
bcm5719-llvm-151c032c86aa7de4244a9ed52d420ecb09550d0b.zip
This patch makes Clang-independent base classes for all the expression types that lldb currently vends.
Before we had: ClangFunction ClangUtilityFunction ClangUserExpression and code all over in lldb that explicitly made Clang-based expressions. This patch adds an Expression base class, and three pure virtual implementations for the Expression kinds: FunctionCaller UtilityFunction UserExpression You can request one of these expression types from the Target using the Get<ExpressionType>ForLanguage. The Target will then consult all the registered TypeSystem plugins, and if the type system that matches the language can make an expression of that kind, it will do so and return it. Because all of the real expression types need to communicate with their ExpressionParser in a uniform way, I also added a ExpressionTypeSystemHelper class that expressions generically can vend, and a ClangExpressionHelper that encapsulates the operations that the ClangExpressionParser needs to perform on the ClangExpression types. Then each of the Clang* expression kinds constructs the appropriate helper to do what it needs. The patch also fixes a wart in the UtilityFunction that to use it you had to create a parallel FunctionCaller to actually call the function made by the UtilityFunction. Now the UtilityFunction can be asked to vend a FunctionCaller that will run its function. This cleaned up a lot of boiler plate code using UtilityFunctions. Note, in this patch all the expression types explicitly depend on the LLVM JIT and IR, and all the common JIT running code is in the FunctionCaller etc base classes. At some point we could also abstract that dependency but I don't see us adding another back end in the near term, so I'll leave that exercise till it is actually necessary. llvm-svn: 247720
Diffstat (limited to 'lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h')
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h
index 5c086c61978..51182a62493 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h
@@ -18,11 +18,11 @@
// Project includes
#include "lldb/lldb-public.h"
#include "lldb/Core/Error.h"
-#include "lldb/Expression/ClangFunction.h"
+#include "lldb/Expression/UtilityFunction.h"
#include "lldb/Host/Mutex.h"
#include "lldb/Symbol/CompilerType.h"
-// This class will insert a ClangUtilityFunction into the inferior process for
+// This class will insert a UtilityFunction into the inferior process for
// calling libBacktraceRecording's __introspection_dispatch_queue_item_get_info()
// function. The function in the inferior will return a struct by value
// with these members:
@@ -37,7 +37,7 @@
// space (item_buffer_size in size) which must be mach_vm_deallocate'd by
// lldb.
//
-// The AppleGetItemInfoHandler object should persist so that the ClangUtilityFunction
+// The AppleGetItemInfoHandler object should persist so that the UtilityFunction
// can be reused multiple times.
namespace lldb_private
@@ -104,8 +104,7 @@ private:
static const char *g_get_item_info_function_code;
lldb_private::Process *m_process;
- std::unique_ptr<ClangFunction> m_get_item_info_function;
- std::unique_ptr<ClangUtilityFunction> m_get_item_info_impl_code;
+ std::unique_ptr<UtilityFunction> m_get_item_info_impl_code;
Mutex m_get_item_info_function_mutex;
lldb::addr_t m_get_item_info_return_buffer_addr;
OpenPOWER on IntegriCloud