Skip to content

Commit

Permalink
GDV-58: [CPP] Fix order of includes. (apache#25)
Browse files Browse the repository at this point in the history
* GDV-58: [CPP] Fix order of includes.

Fixing the order of includes to follow style guideline.
The order to follow is documented here : https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
Also enabled the check in lint.
  • Loading branch information
praveenbingo committed Sep 10, 2018
1 parent 87468de commit 762a363
Show file tree
Hide file tree
Showing 39 changed files with 98 additions and 51 deletions.
4 changes: 3 additions & 1 deletion cpp/src/gandiva/codegen/annotator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "codegen/annotator.h"

#include <memory>
#include <string>
#include "codegen/annotator.h"

#include "codegen/field_descriptor.h"

namespace gandiva {
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/gandiva/codegen/annotator.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@

#include <list>
#include <string>
#include <vector>
#include <unordered_map>
#include <vector>

#include "codegen/eval_batch.h"
#include "gandiva/arrow.h"
#include "gandiva/gandiva_aliases.h"
#include "gandiva/logging.h"
#include "codegen/eval_batch.h"

namespace gandiva {

Expand Down
6 changes: 4 additions & 2 deletions cpp/src/gandiva/codegen/annotator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "codegen/annotator.h"

#include <memory>
#include <gtest/gtest.h>

#include <arrow/memory_pool.h>
#include "codegen/annotator.h"
#include <gtest/gtest.h>
#include "codegen/field_descriptor.h"

namespace gandiva {
Expand Down
1 change: 1 addition & 0 deletions cpp/src/gandiva/codegen/arrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <memory>
#include <vector>

#include <arrow/builder.h>
#include <arrow/record_batch.h>
#include <arrow/type.h>
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/gandiva/codegen/dex.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@

#include <string>
#include <vector>
#include "gandiva/gandiva_aliases.h"

#include "codegen/dex_visitor.h"
#include "codegen/field_descriptor.h"
#include "codegen/func_descriptor.h"
#include "codegen/literal_holder.h"
#include "codegen/native_function.h"
#include "codegen/value_validity_pair.h"
#include "gandiva/gandiva_aliases.h"

namespace gandiva {

Expand Down
6 changes: 4 additions & 2 deletions cpp/src/gandiva/codegen/dex_llvm_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <gtest/gtest.h>
#include "codegen/dex.h"

#include <map>
#include <typeinfo>
#include "codegen/dex.h"

#include <gtest/gtest.h>

namespace gandiva {

Expand Down
16 changes: 9 additions & 7 deletions cpp/src/gandiva/codegen/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "codegen/engine.h"

#include <iostream>
#include <sstream>
#include <string>
#include <unordered_set>
#include <utility>

#include <llvm/Analysis/Passes.h>
#include <llvm/Analysis/TargetTransformInfo.h>
#include <llvm/Bitcode/BitcodeReader.h>
#include "llvm/ExecutionEngine/MCJIT.h"
#include <llvm/ExecutionEngine/MCJIT.h>
#include <llvm/IR/DataLayout.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/Verifier.h>
Expand All @@ -28,12 +36,6 @@
#include <llvm/Transforms/Scalar.h>
#include <llvm/Transforms/Vectorize.h>
#include <llvm/Transforms/Scalar/GVN.h>
#include <iostream>
#include <sstream>
#include <string>
#include <unordered_set>
#include <utility>
#include "codegen/engine.h"

namespace gandiva {

Expand Down
7 changes: 4 additions & 3 deletions cpp/src/gandiva/codegen/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
#ifndef GANDIVA_ENGINE_H
#define GANDIVA_ENGINE_H

#include <memory>
#include <string>
#include <vector>

#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/Module.h>
#include <memory>
#include <string>
#include <vector>
#include "gandiva/logging.h"
#include "gandiva/status.h"

Expand Down
3 changes: 2 additions & 1 deletion cpp/src/gandiva/codegen/engine_llvm_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <gtest/gtest.h>
#include "codegen/engine.h"

#include <gtest/gtest.h>
#include "codegen/llvm_types.h"

namespace gandiva {
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/gandiva/codegen/eval_batch.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2017-2018 Dremio Corporation
// Copyright (C) 2017-2018 Dremio Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,8 @@
#ifndef GANDIVA_EXPR_EVALBATCH_H
#define GANDIVA_EXPR_EVALBATCH_H

#include <arrow/util/logging.h>
#include "gandiva/arrow.h"
#include "gandiva/gandiva_aliases.h"

namespace gandiva {
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/gandiva/codegen/expr_decomposer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
#include <stack>
#include <string>
#include <vector>

#include "codegen/annotator.h"
#include "codegen/dex.h"
#include "codegen/node.h"
#include "codegen/function_registry.h"
#include "codegen/function_signature.h"
#include "codegen/annotator.h"
#include "codegen/node.h"

namespace gandiva {

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/gandiva/codegen/expr_decomposer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
#include <stack>
#include <memory>
#include <utility>
#include <gtest/gtest_prod.h>

#include "gandiva/expression.h"
#include <gtest/gtest_prod.h>
#include "codegen/node_visitor.h"
#include "codegen/node.h"
#include "gandiva/expression.h"

namespace gandiva {

Expand Down
3 changes: 2 additions & 1 deletion cpp/src/gandiva/codegen/expr_decomposer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "codegen/expr_decomposer.h"

#include <gtest/gtest.h>
#include "gandiva/gandiva_aliases.h"
#include "gandiva/tree_expr_builder.h"
#include "codegen/annotator.h"
#include "codegen/dex.h"
#include "codegen/expr_decomposer.h"
#include "codegen/function_signature.h"
#include "codegen/function_registry.h"
#include "codegen/node.h"
Expand Down
1 change: 1 addition & 0 deletions cpp/src/gandiva/codegen/field_descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define GANDIVA_FIELDDESCRIPTOR_H

#include <string>

#include "gandiva/arrow.h"

namespace gandiva {
Expand Down
1 change: 1 addition & 0 deletions cpp/src/gandiva/codegen/func_descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <string>
#include <vector>

#include "gandiva/arrow.h"

namespace gandiva {
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/gandiva/codegen/function_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <vector>
#include "codegen/function_registry.h"

#include <vector>

namespace gandiva {

using std::vector;
Expand Down
1 change: 1 addition & 0 deletions cpp/src/gandiva/codegen/function_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define GANDIVA_FUNCTION_REGISTRY_H

#include <unordered_map>

#include "codegen/native_function.h"

namespace gandiva {
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/gandiva/codegen/function_registry_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <gtest/gtest.h>
#include "codegen/function_registry.h"

#include <gtest/gtest.h>

namespace gandiva {

class TestFunctionRegistry : public ::testing::Test {
Expand Down
1 change: 1 addition & 0 deletions cpp/src/gandiva/codegen/function_signature.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <string>
#include <sstream>
#include <vector>

#include "boost/functional/hash.hpp"
#include "gandiva/arrow.h"
#include "gandiva/logging.h"
Expand Down
6 changes: 4 additions & 2 deletions cpp/src/gandiva/codegen/function_signature_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <gtest/gtest.h>
#include <memory>
#include "codegen/function_signature.h"

#include <memory>

#include <gtest/gtest.h>

namespace gandiva {

class TestFunctionSignature : public ::testing::Test {
Expand Down
1 change: 1 addition & 0 deletions cpp/src/gandiva/codegen/literal_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define GANDIVA_LITERAL_HOLDER

#include <string>

#include <boost/variant.hpp>

namespace gandiva {
Expand Down
6 changes: 4 additions & 2 deletions cpp/src/gandiva/codegen/llvm_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "codegen/llvm_generator.h"

#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include "gandiva/expression.h"

#include "codegen/bitmap_dex_visitor.h"
#include "codegen/dex.h"
#include "codegen/expr_decomposer.h"
#include "codegen/function_registry.h"
#include "codegen/llvm_generator.h"
#include "codegen/lvalue.h"
#include "gandiva/expression.h"

namespace gandiva {

Expand Down
9 changes: 5 additions & 4 deletions cpp/src/gandiva/codegen/llvm_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@
#include <string>
#include <vector>
#include <cstdint>

#include <gtest/gtest_prod.h>
#include "gandiva/gandiva_aliases.h"
#include "codegen/dex_visitor.h"
#include "codegen/annotator.h"
#include "codegen/compiled_expr.h"
#include "codegen/dex_visitor.h"
#include "codegen/engine.h"
#include "codegen/function_registry.h"
#include "codegen/value_validity_pair.h"
#include "codegen/llvm_types.h"
#include "codegen/lvalue.h"
#include "codegen/annotator.h"
#include "codegen/value_validity_pair.h"
#include "gandiva/gandiva_aliases.h"

namespace gandiva {

Expand Down
6 changes: 4 additions & 2 deletions cpp/src/gandiva/codegen/llvm_generator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "codegen/llvm_generator.h"

#include <memory>
#include <vector>

#include <gtest/gtest.h>
#include "gandiva/expression.h"
#include "codegen/dex.h"
#include "codegen/func_descriptor.h"
#include "codegen/function_registry.h"
#include "codegen/llvm_generator.h"
#include "gandiva/expression.h"

namespace gandiva {

Expand Down
3 changes: 2 additions & 1 deletion cpp/src/gandiva/codegen/llvm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
#ifndef GANDIVA_LLVM_TYPES_H
#define GANDIVA_LLVM_TYPES_H

#include <map>

#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/LLVMContext.h>
#include <map>
#include "gandiva/arrow.h"

namespace gandiva {
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/gandiva/codegen/llvm_types_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "codegen/llvm_types.h"

#include <gtest/gtest.h>
#include "./llvm_types.h"

namespace gandiva {

Expand Down
1 change: 1 addition & 0 deletions cpp/src/gandiva/codegen/native_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <memory>
#include <string>
#include <vector>

#include "codegen/function_signature.h"

namespace gandiva {
Expand Down
7 changes: 4 additions & 3 deletions cpp/src/gandiva/codegen/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

#include <string>
#include <vector>
#include "gandiva/arrow.h"
#include "gandiva/gandiva_aliases.h"
#include "codegen/node_visitor.h"

#include "codegen/func_descriptor.h"
#include "codegen/literal_holder.h"
#include "codegen/node_visitor.h"
#include "gandiva/arrow.h"
#include "gandiva/gandiva_aliases.h"

namespace gandiva {

Expand Down
Loading

0 comments on commit 762a363

Please sign in to comment.