diff options
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h')
-rw-r--r-- | lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h index 7aad7058d86..c19835d6bfb 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h @@ -19,6 +19,8 @@ #include <vector> // Other libraries and framework includes +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" // Project includes #include "lldb/Core/Module.h" #include "lldb/Expression/LLVMUserExpression.h" @@ -33,6 +35,7 @@ typedef uint32_t RSSlot; class RSModuleDescriptor; struct RSGlobalDescriptor; struct RSKernelDescriptor; +struct RSReductionDescriptor; typedef std::shared_ptr<RSModuleDescriptor> RSModuleDescriptorSP; typedef std::shared_ptr<RSGlobalDescriptor> RSGlobalDescriptorSP; @@ -75,7 +78,7 @@ protected: struct RSKernelDescriptor { public: - RSKernelDescriptor(const RSModuleDescriptor *module, const char *name, + RSKernelDescriptor(const RSModuleDescriptor *module, llvm::StringRef name, uint32_t slot) : m_module(module), m_name(name), m_slot(slot) {} @@ -88,7 +91,7 @@ public: struct RSGlobalDescriptor { public: - RSGlobalDescriptor(const RSModuleDescriptor *module, const char *name) + RSGlobalDescriptor(const RSModuleDescriptor *module, llvm::StringRef name) : m_module(module), m_name(name) {} void Dump(Stream &strm) const; @@ -97,7 +100,56 @@ public: ConstString m_name; }; +struct RSReductionDescriptor { + RSReductionDescriptor(const RSModuleDescriptor *module, uint32_t sig, + uint32_t accum_data_size, llvm::StringRef name, + llvm::StringRef init_name, llvm::StringRef accum_name, + llvm::StringRef comb_name, llvm::StringRef outc_name, + llvm::StringRef halter_name = ".") + : m_module(module), m_reduce_name(name), m_init_name(init_name), + m_accum_name(accum_name), m_comb_name(comb_name), + m_outc_name(outc_name), m_halter_name(halter_name) { + // TODO Check whether the combiner is an autogenerated name, and track + // this + } + + void Dump(Stream &strm) const; + + const RSModuleDescriptor *m_module; + ConstString m_reduce_name; // This is the name given to the general reduction + // as a group as passed to pragma + // reduce(m_reduce_name). There is no kernel function with this name + ConstString m_init_name; // The name of the initializer name. "." if no + // initializer given + ConstString m_accum_name; // The accumulator function name. "." if not given + ConstString m_comb_name; // The name of the combiner function. If this was not + // given, a name is generated by the + // compiler. TODO + ConstString m_outc_name; // The name of the outconverter + + ConstString m_halter_name; // The name of the halter function. XXX This is not + // yet specified by the RenderScript + // compiler or runtime, and its semantics and existence is still under + // discussion by the + // RenderScript Contributors + RSSlot m_accum_sig; // metatdata signature for this reduction (bitwise mask of + // type information (see + // libbcc/include/bcinfo/MetadataExtractor.h + uint32_t m_accum_data_size; // Data size of the accumulator function input + bool m_comb_name_generated; // Was the combiner name generated by the compiler +}; + class RSModuleDescriptor { + bool ParseExportForeachCount(llvm::StringRef *, size_t n_lines); + + bool ParseExportVarCount(llvm::StringRef *, size_t n_lines); + + bool ParseExportReduceCount(llvm::StringRef *, size_t n_lines); + + bool ParseBuildChecksum(llvm::StringRef *, size_t n_lines); + + bool ParsePragmaCount(llvm::StringRef *, size_t n_lines); + public: RSModuleDescriptor(const lldb::ModuleSP &module) : m_module(module) {} @@ -110,6 +162,7 @@ public: const lldb::ModuleSP m_module; std::vector<RSKernelDescriptor> m_kernels; std::vector<RSGlobalDescriptor> m_globals; + std::vector<RSReductionDescriptor> m_reductions; std::map<std::string, std::string> m_pragmas; std::string m_resname; }; |