Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
50fd9140
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,体验更适合开发者的 AI 搜索 >>
提交
50fd9140
编写于
7月 11, 2016
作者:
S
Shreedhar Hardikar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix cpplint errors
上级
88a04412
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
498 addition
and
481 deletion
+498
-481
src/backend/codegen/exec_variable_list_codegen.cc
src/backend/codegen/exec_variable_list_codegen.cc
+9
-3
src/backend/codegen/include/codegen/exec_variable_list_codegen.h
...kend/codegen/include/codegen/exec_variable_list_codegen.h
+1
-1
src/backend/codegen/include/codegen/slot_getattr_codegen.h
src/backend/codegen/include/codegen/slot_getattr_codegen.h
+3
-1
src/backend/codegen/op_expr_tree_generator.cc
src/backend/codegen/op_expr_tree_generator.cc
+2
-1
src/backend/codegen/pg_date_func_generator.cc
src/backend/codegen/pg_date_func_generator.cc
+8
-5
src/backend/codegen/slot_getattr_codegen.cc
src/backend/codegen/slot_getattr_codegen.cc
+469
-467
src/backend/codegen/tests/codegen_utils_unittest.cc
src/backend/codegen/tests/codegen_utils_unittest.cc
+6
-3
未找到文件。
src/backend/codegen/exec_variable_list_codegen.cc
浏览文件 @
50fd9140
...
...
@@ -137,10 +137,16 @@ bool ExecVariableListCodegen::GenerateExecVariableList(
// Generate slot_getattr for attributes all the way to max_attr
std
::
string
slot_getattr_func_name
=
"slot_getattr_"
+
std
::
to_string
(
max_attr
);
std
::
string
slot_getattr_func_name
=
"slot_getattr_"
+
std
::
to_string
(
max_attr
);
llvm
::
Function
*
slot_getattr_func
=
nullptr
;
if
(
!
SlotGetAttrCodegen
::
GenerateSlotGetAttr
(
codegen_utils
,
slot_getattr_func_name
,
slot_
,
max_attr
,
&
slot_getattr_func
))
{
bool
ok
=
SlotGetAttrCodegen
::
GenerateSlotGetAttr
(
codegen_utils
,
slot_getattr_func_name
,
slot_
,
max_attr
,
&
slot_getattr_func
);
if
(
!
ok
)
{
elog
(
DEBUG1
,
"Cannot generate code for ExecVariableList "
"because slot_getattr generation failed!"
);
return
false
;
...
...
src/backend/codegen/include/codegen/exec_variable_list_codegen.h
浏览文件 @
50fd9140
...
...
@@ -42,7 +42,7 @@ class ExecVariableListCodegen: public BaseCodegen<ExecVariableListFn> {
virtual
~
ExecVariableListCodegen
()
=
default
;
protected:
protected:
/**
* @brief Generate code for the code path ExecVariableList > slot_getattr >
* _slot_getsomeattrs > slot_deform_tuple.
...
...
src/backend/codegen/include/codegen/slot_getattr_codegen.h
浏览文件 @
50fd9140
...
...
@@ -13,6 +13,8 @@
#ifndef GPCODEGEN_SLOT_GETATTR_CODEGEN_H_ // NOLINT(build/header_guard)
#define GPCODEGEN_SLOT_GETATTR_CODEGEN_H_
#include <string>
#include "codegen/codegen_wrapper.h"
#include "codegen/utils/gp_codegen_utils.h"
...
...
@@ -84,4 +86,4 @@ class SlotGetAttrCodegen {
/** @} */
}
// namespace gpcodegen
#endif // GPCODEGEN_SLOT_GETATTR_CODEGEN_H_
#endif
// GPCODEGEN_SLOT_GETATTR_CODEGEN_H_
src/backend/codegen/op_expr_tree_generator.cc
浏览文件 @
50fd9140
...
...
@@ -15,10 +15,11 @@
#include "include/codegen/pg_arith_func_generator.h"
#include "include/codegen/pg_date_func_generator.h"
#include "llvm/IR/Value.h"
extern
"C"
{
#include "c.h"
#include "c.h"
// NOLINT(build/include)
#include "postgres.h" // NOLINT(build/include)
#include "utils/elog.h"
#include "nodes/execnodes.h"
...
...
src/backend/codegen/pg_date_func_generator.cc
浏览文件 @
50fd9140
...
...
@@ -15,7 +15,7 @@
#include "codegen/utils/gp_codegen_utils.h"
extern
"C"
{
#include "postgres.h"
#include "postgres.h"
// NOLINT(build/include)
#include "utils/elog.h"
#include "utils/date.h"
#include "utils/timestamp.h"
...
...
@@ -44,10 +44,11 @@ bool PGDateFuncGenerator::DateLETimestamp(
// timestamp_cmp_internal {{{
#ifdef HAVE_INT64_TIMESTAMP
*
llvm_out_value
=
irb
->
CreateICmpSLE
(
llvm_arg0_Timestamp
,
llvm_arg1_Timestamp
);
*
llvm_out_value
=
irb
->
CreateICmpSLE
(
llvm_arg0_Timestamp
,
llvm_arg1_Timestamp
);
#else
//
TODO:
We do not support NaNs.
elog
(
DEBUG1
,
"Timestamp != int_64: NaNs are not supported."
);
// We do not support NaNs.
elog
(
DEBUG1
,
"Timestamp != int_64: NaNs are not supported."
);
return
false
;
#endif
// }}}
...
...
@@ -83,7 +84,9 @@ llvm::Value* PGDateFuncGenerator::GenerateDate2Timestamp(
llvm
::
Value
*
llvm_overflow_flag
=
irb
->
CreateExtractValue
(
llvm_mul_output
,
1
);
irb
->
CreateCondBr
(
llvm_overflow_flag
,
llvm_overflow_block
,
llvm_non_overflow_block
);
irb
->
CreateCondBr
(
llvm_overflow_flag
,
llvm_overflow_block
,
llvm_non_overflow_block
);
irb
->
SetInsertPoint
(
llvm_overflow_block
);
codegen_utils
->
CreateElog
(
ERROR
,
"date out of range for timestamp"
);
...
...
src/backend/codegen/slot_getattr_codegen.cc
浏览文件 @
50fd9140
此差异已折叠。
点击以展开。
src/backend/codegen/tests/codegen_utils_unittest.cc
浏览文件 @
50fd9140
...
...
@@ -2778,15 +2778,18 @@ TEST_F(CodegenUtilsTest, InlineFunctionTest) {
typedef
int
(
*
AddConstToIntFn
)
(
int
);
// Create a simple adds 1 to a number and returns the new value
llvm
::
Function
*
add_one_fn
=
codegen_utils_
->
CreateFunction
<
AddConstToIntFn
>
(
"add_one"
);
llvm
::
Function
*
add_one_fn
=
codegen_utils_
->
CreateFunction
<
AddConstToIntFn
>
(
"add_one"
);
irb
->
SetInsertPoint
(
codegen_utils_
->
CreateBasicBlock
(
"main"
,
add_one_fn
));
irb
->
CreateRet
(
irb
->
CreateAdd
(
ArgumentByPosition
(
add_one_fn
,
0
),
codegen_utils_
->
GetConstant
(
1
)));
// Create another simple function add_two which calls add_one twice
llvm
::
Function
*
add_two_fn
=
codegen_utils_
->
CreateFunction
<
AddConstToIntFn
>
(
"add_two"
);
llvm
::
Function
*
add_two_fn
=
codegen_utils_
->
CreateFunction
<
AddConstToIntFn
>
(
"add_two"
);
irb
->
SetInsertPoint
(
codegen_utils_
->
CreateBasicBlock
(
"main"
,
add_two_fn
));
llvm
::
CallInst
*
first_call
=
irb
->
CreateCall
(
add_one_fn
,
{
ArgumentByPosition
(
add_two_fn
,
0
)});
llvm
::
CallInst
*
first_call
=
irb
->
CreateCall
(
add_one_fn
,
{
ArgumentByPosition
(
add_two_fn
,
0
)});
llvm
::
CallInst
*
second_call
=
irb
->
CreateCall
(
add_one_fn
,
{
first_call
});
irb
->
CreateRet
(
second_call
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录