Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
d7fb2f6d
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 搜索 >>
提交
d7fb2f6d
编写于
6月 30, 2016
作者:
S
Shreedhar Hardikar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix codegen unittests on Linux and various compiler warnings while building codegen.
上级
dea16d7d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
21 addition
and
22 deletion
+21
-22
src/backend/codegen/CMakeLists.txt
src/backend/codegen/CMakeLists.txt
+6
-1
src/backend/codegen/exec_eval_expr_codegen.cc
src/backend/codegen/exec_eval_expr_codegen.cc
+0
-4
src/backend/codegen/exec_variable_list_codegen.cc
src/backend/codegen/exec_variable_list_codegen.cc
+4
-6
src/backend/codegen/include/codegen/expr_tree_generator.h
src/backend/codegen/include/codegen/expr_tree_generator.h
+1
-2
src/backend/codegen/include/codegen/utils/utility.h
src/backend/codegen/include/codegen/utils/utility.h
+1
-1
src/backend/codegen/op_expr_tree_generator.cc
src/backend/codegen/op_expr_tree_generator.cc
+2
-1
src/backend/codegen/tests/codegen_framework_unittest.cc
src/backend/codegen/tests/codegen_framework_unittest.cc
+1
-1
src/backend/codegen/tests/codegen_utils_unittest.cc
src/backend/codegen/tests/codegen_utils_unittest.cc
+6
-6
未找到文件。
src/backend/codegen/CMakeLists.txt
浏览文件 @
d7fb2f6d
...
...
@@ -55,6 +55,12 @@ if (COMPILER_HAS_WNO_C99_EXTENSIONS)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-conversion-null"
)
endif
()
# Suppress warnings about deprecated keyword register
CHECK_CXX_COMPILER_FLAG
(
"-Wno-deprecated-register"
COMPILER_HAS_WNO_C99_EXTENSIONS
)
if
(
COMPILER_HAS_WNO_C99_EXTENSIONS
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-deprecated-register"
)
endif
()
# Turn on the CODEGEN_DEBUG flag if this is a debug build.
if
(
CMAKE_MAJOR_VERSION GREATER 2
)
cmake_policy
(
SET CMP0043 NEW
)
...
...
@@ -304,7 +310,6 @@ endif()
if
(
EXISTS
${
TXT_OBJFILE
}
)
add_cmockery_gtest
(
codegen_framework_unittest.t
tests/codegen_framework_unittest.cc
${
MOCK_DIR
}
/backend/utils/error/elog_mock.o
)
endif
()
...
...
src/backend/codegen/exec_eval_expr_codegen.cc
浏览文件 @
d7fb2f6d
...
...
@@ -76,11 +76,7 @@ bool ExecEvalExprCodegen::GenerateExecEvalExpr(
codegen_utils
,
GetUniqueFuncName
());
// Function arguments to ExecVariableList
llvm
::
Value
*
llvm_expression_arg
=
ArgumentByPosition
(
exec_eval_expr_func
,
0
);
llvm
::
Value
*
llvm_econtext_arg
=
ArgumentByPosition
(
exec_eval_expr_func
,
1
);
llvm
::
Value
*
llvm_isnull_arg
=
ArgumentByPosition
(
exec_eval_expr_func
,
2
);
llvm
::
Value
*
llvm_isDone_arg
=
ArgumentByPosition
(
exec_eval_expr_func
,
3
);
// BasicBlock of function entry.
llvm
::
BasicBlock
*
llvm_entry_block
=
codegen_utils
->
CreateBasicBlock
(
...
...
src/backend/codegen/exec_variable_list_codegen.cc
浏览文件 @
d7fb2f6d
...
...
@@ -161,9 +161,6 @@ bool ExecVariableListCodegen::GenerateExecVariableList(
llvm
::
Value
*
llvm_econtext
=
irb
->
CreateLoad
(
codegen_utils
->
GetPointerToMember
(
llvm_projInfo_arg
,
&
ProjectionInfo
::
pi_exprContext
));
llvm
::
Value
*
llvm_varSlotOffsets
=
irb
->
CreateLoad
(
codegen_utils
->
GetPointerToMember
(
llvm_projInfo_arg
,
&
ProjectionInfo
::
pi_varSlotOffsets
));
// We want to fall back when ExecVariableList is called with a slot that's
// different from the one we generated the function (eg HashJoin). We also
...
...
@@ -325,7 +322,7 @@ bool ExecVariableListCodegen::GenerateExecVariableList(
// Create the block of (attnum+1)th attribute and jump to it after
// you finish with current attribute.
next_attribute_block
=
codegen_utils
->
CreateBasicBlock
(
"attribute_block_"
+
(
attnum
+
1
),
exec_variable_list_func
);
"attribute_block_"
+
std
::
to_string
(
attnum
+
1
),
exec_variable_list_func
);
llvm
::
Value
*
llvm_next_values_ptr
=
irb
->
CreateInBoundsGEP
(
llvm_slot_PRIVATE_tts_values
,
...
...
@@ -336,9 +333,10 @@ bool ExecVariableListCodegen::GenerateExecVariableList(
if
(
!
thisatt
->
attnotnull
)
{
// Create blocks
is_null_block
=
codegen_utils
->
CreateBasicBlock
(
"is_null_block_"
+
attnum
,
exec_variable_list_func
);
"is_null_block_"
+
std
::
to_string
(
attnum
)
,
exec_variable_list_func
);
is_not_null_block
=
codegen_utils
->
CreateBasicBlock
(
"is_not_null_block_"
+
attnum
,
exec_variable_list_func
);
"is_not_null_block_"
+
std
::
to_string
(
attnum
),
exec_variable_list_func
);
llvm
::
Value
*
llvm_attnum
=
codegen_utils
->
GetConstant
(
attnum
);
...
...
src/backend/codegen/include/codegen/expr_tree_generator.h
浏览文件 @
d7fb2f6d
...
...
@@ -93,11 +93,10 @@ class ExprTreeGenerator {
**/
ExprTreeGenerator
(
ExprState
*
expr_state
,
ExprTreeNodeType
node_type
)
:
expr_state_
(
expr_state
)
,
node_type_
(
node_type
)
{}
expr_state_
(
expr_state
)
{}
private:
ExprState
*
expr_state_
;
ExprTreeNodeType
node_type_
;
DISALLOW_COPY_AND_ASSIGN
(
ExprTreeGenerator
);
};
...
...
src/backend/codegen/include/codegen/utils/utility.h
浏览文件 @
d7fb2f6d
...
...
@@ -33,7 +33,7 @@ namespace gpcodegen {
* @return A pointer to the specified argument, or NULL if the specified
* position was beyond the end of function's arguments.
**/
static
llvm
::
Argument
*
ArgumentByPosition
(
llvm
::
Function
*
function
,
static
inline
llvm
::
Argument
*
ArgumentByPosition
(
llvm
::
Function
*
function
,
const
unsigned
position
)
{
llvm
::
Function
::
arg_iterator
it
=
function
->
arg_begin
();
if
(
it
==
function
->
arg_end
())
{
...
...
src/backend/codegen/op_expr_tree_generator.cc
浏览文件 @
d7fb2f6d
...
...
@@ -92,7 +92,8 @@ bool OpExprTreeGenerator::VerifyAndCreateExprTree(
List
*
arguments
=
reinterpret_cast
<
FuncExprState
*>
(
expr_state
)
->
args
;
assert
(
nullptr
!=
arguments
);
// In ExecEvalFuncArgs
assert
(
list_length
(
arguments
)
==
itr
->
second
->
GetTotalArgCount
());
assert
(
list_length
(
arguments
)
==
static_cast
<
int
>
(
itr
->
second
->
GetTotalArgCount
()));
ListCell
*
arg
=
nullptr
;
bool
supported_tree
=
true
;
...
...
src/backend/codegen/tests/codegen_framework_unittest.cc
浏览文件 @
d7fb2f6d
...
...
@@ -48,7 +48,7 @@
extern
"C"
{
#include "utils/elog.h"
#undef elog
#define elog
#define elog
(...)
}
#include "codegen/utils/codegen_utils.h"
...
...
src/backend/codegen/tests/codegen_utils_unittest.cc
浏览文件 @
d7fb2f6d
...
...
@@ -1076,7 +1076,7 @@ class CodegenUtilsTest : public ::testing::Test {
InputType
*
input
=
new
InputType
[
input_size
];
for
(
size_t
idx
=
0
;
idx
<
input_size
;
++
idx
)
{
unsigned
int
seed
=
idx
;
input
[
idx
]
=
rand_r
(
&
seed
)
%
(
2
^
(
sizeof
(
InputType
)
*
8
)
-
1
);
input
[
idx
]
=
rand_r
(
&
seed
)
%
(
(
2
^
(
sizeof
(
InputType
)
*
8
)
)
-
1
);
}
return
input
;
}
...
...
@@ -2754,12 +2754,12 @@ TEST_F(CodegenUtilsTest, GetOrGetOrRegisterExternalFunctionTest) {
EXPECT_EQ
(
expected_fabs_func
,
fabs_func
);
// Test previously registered vararg function
llvm
::
Function
*
expected_
v
printf_func
=
codegen_utils_
->
GetOrRegisterExternalFunction
(
v
printf
);
llvm
::
Function
*
v
printf_func
=
codegen_utils_
->
GetOrRegisterExternalFunction
(
v
printf
);
llvm
::
Function
*
expected_
f
printf_func
=
codegen_utils_
->
GetOrRegisterExternalFunction
(
f
printf
);
llvm
::
Function
*
f
printf_func
=
codegen_utils_
->
GetOrRegisterExternalFunction
(
f
printf
);
EXPECT_EQ
(
expected_
vprintf_func
,
v
printf_func
);
EXPECT_EQ
(
expected_
fprintf_func
,
f
printf_func
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录