Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Utility class to manipulate c++/IR symbols, mangling and demangling names. More...
#include <symbols-util.h>
Static Public Member Functions | |
static bool | IsMangled (const std::string &symbol) |
Returns true if this symbol is mangled. More... | |
static std::string | Demangle (const std::string &name) |
static std::string | DemangleNameOnly (const std::string &symbol) |
static std::string | MangleUserFunction (const std::string &fn_name, const std::vector< ColumnType > &arg_types, bool has_var_args=false, ColumnType *ret_argument=NULL) |
static std::string | ManglePrepareOrCloseFunction (const std::string &fn_name) |
Utility class to manipulate c++/IR symbols, mangling and demangling names.
Definition at line 24 of file symbols-util.h.
|
static |
Returns the demangled string. The name is assumed to be a mangled string using the gcc/llvm convention. Returns the empty string if the name is not valid.
Definition at line 57 of file symbols-util.cc.
Referenced by DemangleNameOnly(), impala::TestDemangling(), impala::TestMangling(), and impala::TestManglingPrepareOrClose().
|
static |
Returns the function name of the demangled symbol (i.e., it strips the arguments and any namespace/class qualifiers). Returns the empty string if the name is not valid.
Definition at line 66 of file symbols-util.cc.
References Demangle(), and gen_ir_descriptions::fn_name.
Referenced by impala::ScalarFnCall::GetCodegendComputeFn(), and impala::TestDemanglingNameOnly().
|
static |
Returns true if this symbol is mangled.
Definition at line 53 of file symbols-util.cc.
References MANGLE_PREFIX.
Referenced by ResolveSymbolLookup().
|
static |
Mangles fn_name assuming arguments (impala_udf::FunctionContext*, impala_udf::FunctionContext::FunctionStateScope).
Definition at line 236 of file symbols-util.cc.
References AppendMangledToken(), and MANGLE_PREFIX.
Referenced by ResolveSymbolLookup(), and impala::TestManglingPrepareOrClose().
|
static |
Mangles fn_name with 'arg_types' to the function signature for user functions. This maps types to AnyVal* and automatically adds the FunctionContext* as the first argument. The fn_name must be fully qualified. i.e namespace::class::fn. if 'has_var_args' is true, the last argument in arg_types can be variable. if 'ret_argument' is non-null, it is added as a last return argument. TODO: this is not a general mangling function and that is more difficult to do. Find a library to do this. There is no place we require this to be perfect, if we can't do this right, the user will need to specify the full mangled string.
Definition at line 154 of file symbols-util.cc.
References AppendAnyValType(), AppendMangledToken(), AppendSeqId(), MANGLE_PREFIX, and impala::ColumnType::type.
Referenced by ResolveSymbolLookup(), and impala::TestMangling().