Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
5996aaa7
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5996aaa7
编写于
7月 27, 2016
作者:
S
Shreedhar Hardikar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Keep a reference to the CodegenManager in code generators
上级
c1a94208
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
34 addition
and
21 deletion
+34
-21
src/backend/codegen/codegen_wrapper.cc
src/backend/codegen/codegen_wrapper.cc
+1
-1
src/backend/codegen/exec_eval_expr_codegen.cc
src/backend/codegen/exec_eval_expr_codegen.cc
+9
-8
src/backend/codegen/exec_variable_list_codegen.cc
src/backend/codegen/exec_variable_list_codegen.cc
+9
-8
src/backend/codegen/include/codegen/base_codegen.h
src/backend/codegen/include/codegen/base_codegen.h
+11
-2
src/backend/codegen/include/codegen/exec_eval_expr_codegen.h
src/backend/codegen/include/codegen/exec_eval_expr_codegen.h
+2
-1
src/backend/codegen/include/codegen/exec_variable_list_codegen.h
...kend/codegen/include/codegen/exec_variable_list_codegen.h
+2
-1
未找到文件。
src/backend/codegen/codegen_wrapper.cc
浏览文件 @
5996aaa7
...
...
@@ -130,7 +130,7 @@ ClassType* CodegenEnroll(FuncType regular_func_ptr,
}
ClassType
*
generator
=
new
ClassType
(
regular_func_ptr
,
ptr_to_chosen_func_ptr
,
std
::
forward
<
Args
>
(
args
)...);
manager
,
regular_func_ptr
,
ptr_to_chosen_func_ptr
,
std
::
forward
<
Args
>
(
args
)...);
bool
is_enrolled
=
manager
->
EnrollCodeGenerator
(
CodegenFuncLifespan_Parameter_Invariant
,
generator
);
assert
(
is_enrolled
);
...
...
src/backend/codegen/exec_eval_expr_codegen.cc
浏览文件 @
5996aaa7
...
...
@@ -48,18 +48,19 @@ using gpcodegen::SlotGetAttrCodegen;
constexpr
char
ExecEvalExprCodegen
::
kExecEvalExprPrefix
[];
ExecEvalExprCodegen
::
ExecEvalExprCodegen
(
ExecEvalExprCodegen
::
ExecEvalExprCodegen
(
CodegenManager
*
manager
,
ExecEvalExprFn
regular_func_ptr
,
ExecEvalExprFn
*
ptr_to_regular_func_ptr
,
ExprState
*
exprstate
,
ExprContext
*
econtext
,
PlanState
*
plan_state
)
:
BaseCodegen
(
kExecEvalExprPrefix
,
regular_func_ptr
,
ptr_to_regular_func_ptr
),
exprstate_
(
exprstate
),
econtext_
(
econtext
),
plan_state_
(
plan_state
)
{
PlanState
*
plan_state
)
:
BaseCodegen
(
manager
,
kExecEvalExprPrefix
,
regular_func_ptr
,
ptr_to_regular_func_ptr
),
exprstate_
(
exprstate
),
econtext_
(
econtext
),
plan_state_
(
plan_state
)
{
}
void
ExecEvalExprCodegen
::
PrepareSlotGetAttr
(
...
...
src/backend/codegen/exec_variable_list_codegen.cc
浏览文件 @
5996aaa7
...
...
@@ -51,17 +51,18 @@ using gpcodegen::SlotGetAttrCodegen;
constexpr
char
ExecVariableListCodegen
::
kExecVariableListPrefix
[];
ExecVariableListCodegen
::
ExecVariableListCodegen
(
ExecVariableListCodegen
::
ExecVariableListCodegen
(
CodegenManager
*
manager
,
ExecVariableListFn
regular_func_ptr
,
ExecVariableListFn
*
ptr_to_regular_func_ptr
,
ProjectionInfo
*
proj_info
,
TupleTableSlot
*
slot
)
:
BaseCodegen
(
kExecVariableListPrefix
,
regular_func_ptr
,
ptr_to_regular_func_ptr
),
proj_info_
(
proj_info
),
slot_
(
slot
)
{
TupleTableSlot
*
slot
)
:
BaseCodegen
(
manager
,
kExecVariableListPrefix
,
regular_func_ptr
,
ptr_to_regular_func_ptr
),
proj_info_
(
proj_info
),
slot_
(
slot
)
{
}
...
...
src/backend/codegen/include/codegen/base_codegen.h
浏览文件 @
5996aaa7
...
...
@@ -19,6 +19,7 @@ extern "C" {
#include <string>
#include <vector>
#include "codegen/utils/gp_codegen_utils.h"
#include "codegen/codegen_manager.h"
#include "codegen/codegen_interface.h"
#include "llvm/IR/Function.h"
...
...
@@ -127,6 +128,10 @@ class BaseCodegen: public CodegenInterface {
return
regular_func_ptr_
;
}
gpcodegen
::
CodegenManager
*
manager
()
const
{
return
manager
;
}
/**
* @brief Sets up the caller to use the corresponding regular version of the
* target function.
...
...
@@ -148,6 +153,7 @@ class BaseCodegen: public CodegenInterface {
/**
* @brief Constructor
*
* @param manager The manager in which this is enrolled.
* @param orig_func_name Original function name.
* @param regular_func_ptr Regular version of the target function.
* @param ptr_to_chosen_func_ptr Reference to the function pointer that the caller will call.
...
...
@@ -156,14 +162,16 @@ class BaseCodegen: public CodegenInterface {
* corresponding regular version.
*
**/
explicit
BaseCodegen
(
const
std
::
string
&
orig_func_name
,
explicit
BaseCodegen
(
gpcodegen
::
CodegenManager
*
manager
,
const
std
::
string
&
orig_func_name
,
FuncPtrType
regular_func_ptr
,
FuncPtrType
*
ptr_to_chosen_func_ptr
)
:
orig_func_name_
(
orig_func_name
),
unique_func_name_
(
CodegenInterface
::
GenerateUniqueName
(
orig_func_name
)),
regular_func_ptr_
(
regular_func_ptr
),
ptr_to_chosen_func_ptr_
(
ptr_to_chosen_func_ptr
),
is_generated_
(
false
)
{
is_generated_
(
false
),
manager_
(
manager
)
{
// Initialize the caller to use regular version of target function.
SetToRegular
(
regular_func_ptr
,
ptr_to_chosen_func_ptr
);
}
...
...
@@ -214,6 +222,7 @@ class BaseCodegen: public CodegenInterface {
FuncPtrType
regular_func_ptr_
;
FuncPtrType
*
ptr_to_chosen_func_ptr_
;
bool
is_generated_
;
gpcodegen
::
CodegenManager
*
manager_
;
// To track uncompiled llvm functions it creates and erase from
// llvm module on failed generations.
std
::
vector
<
llvm
::
Function
*>
uncompiled_generated_functions_
;
...
...
src/backend/codegen/include/codegen/exec_eval_expr_codegen.h
浏览文件 @
5996aaa7
...
...
@@ -39,7 +39,8 @@ class ExecEvalExprCodegen: public BaseCodegen<ExecEvalExprFn> {
* function or the corresponding regular version.
*
**/
explicit
ExecEvalExprCodegen
(
ExecEvalExprFn
regular_func_ptr
,
explicit
ExecEvalExprCodegen
(
CodegenManager
*
manager
,
ExecEvalExprFn
regular_func_ptr
,
ExecEvalExprFn
*
ptr_to_regular_func_ptr
,
ExprState
*
exprstate
,
ExprContext
*
econtext
,
...
...
src/backend/codegen/include/codegen/exec_variable_list_codegen.h
浏览文件 @
5996aaa7
...
...
@@ -35,7 +35,8 @@ class ExecVariableListCodegen: public BaseCodegen<ExecVariableListFn> {
* corresponding regular version.
*
**/
explicit
ExecVariableListCodegen
(
ExecVariableListFn
regular_func_ptr
,
explicit
ExecVariableListCodegen
(
CodegenManager
*
manager
,
ExecVariableListFn
regular_func_ptr
,
ExecVariableListFn
*
ptr_to_regular_func_ptr
,
ProjectionInfo
*
proj_info
,
TupleTableSlot
*
slot
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录