提交 50fd9140 编写于 作者: S Shreedhar Hardikar

Fix cpplint errors

上级 88a04412
......@@ -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;
......
......@@ -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.
......
......@@ -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_
......@@ -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"
......
......@@ -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");
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册