Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change C++ .h files into .hpp files for modernisation #610

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Thumbs.db
.vscode
.cache
.ipynb_checkpoints
/Folder.DotSettings.user

# CMake generated files #
#########################
Expand All @@ -68,3 +69,4 @@ jit/codon/version.py
temp/
playground/
scratch*.*

184 changes: 92 additions & 92 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ add_custom_command(
DEPENDS peg2cpp codon/parser/peg/openmp.peg)

# Codon Jupyter library
set(CODON_JUPYTER_FILES codon/util/jupyter.h codon/util/jupyter.cpp)
set(CODON_JUPYTER_FILES codon/util/jupyter.hpp codon/util/jupyter.cpp)
add_library(codon_jupyter SHARED ${CODON_JUPYTER_FILES})

# Codon runtime library
set(CODONRT_FILES codon/runtime/lib.h codon/runtime/lib.cpp
set(CODONRT_FILES codon/runtime/lib.hpp codon/runtime/lib.cpp
codon/runtime/re.cpp codon/runtime/exc.cpp
codon/runtime/gpu.cpp)
add_library(codonrt SHARED ${CODONRT_FILES})
Expand Down Expand Up @@ -122,98 +122,98 @@ add_custom_command(
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
set(CODON_HPPFILES
codon/compiler/compiler.h
codon/compiler/debug_listener.h
codon/compiler/engine.h
codon/compiler/error.h
codon/compiler/jit.h
codon/compiler/memory_manager.h
codon/dsl/dsl.h
codon/dsl/plugins.h
codon/parser/ast.h
codon/parser/ast/expr.h
codon/parser/ast/stmt.h
codon/compiler/compiler.hpp
codon/compiler/debug_listener.hpp
codon/compiler/engine.hpp
codon/compiler/error.hpp
codon/compiler/jit.hpp
codon/compiler/memory_manager.hpp
codon/dsl/dsl.hpp
codon/dsl/plugins.hpp
codon/parser/ast.hpp
codon/parser/ast/expr.hpp
codon/parser/ast/stmt.hpp
codon/parser/ast/types.h
codon/parser/ast/types/type.h
codon/parser/ast/types/link.h
codon/parser/ast/types/class.h
codon/parser/ast/types/function.h
codon/parser/ast/types/union.h
codon/parser/ast/types/static.h
codon/parser/ast/types/traits.h
codon/parser/cache.h
codon/parser/common.h
codon/parser/ctx.h
codon/parser/peg/peg.h
codon/parser/peg/rules.h
codon/parser/visitors/doc/doc.h
codon/parser/visitors/format/format.h
codon/parser/visitors/simplify/simplify.h
codon/parser/visitors/simplify/ctx.h
codon/parser/visitors/translate/translate.h
codon/parser/visitors/translate/translate_ctx.h
codon/parser/visitors/typecheck/typecheck.h
codon/parser/visitors/typecheck/ctx.h
codon/parser/visitors/visitor.h
codon/cir/analyze/analysis.h
codon/cir/analyze/dataflow/capture.h
codon/cir/analyze/dataflow/cfg.h
codon/cir/analyze/dataflow/dominator.h
codon/cir/analyze/dataflow/reaching.h
codon/cir/analyze/module/global_vars.h
codon/cir/analyze/module/side_effect.h
codon/cir/attribute.h
codon/cir/base.h
codon/cir/const.h
codon/cir/dsl/codegen.h
codon/cir/dsl/nodes.h
codon/cir/flow.h
codon/cir/func.h
codon/cir/instr.h
codon/cir/llvm/gpu.h
codon/cir/llvm/llvisitor.h
codon/cir/llvm/llvm.h
codon/cir/llvm/optimize.h
codon/cir/module.h
codon/cir/pyextension.h
codon/cir/cir.h
codon/cir/transform/cleanup/canonical.h
codon/cir/transform/cleanup/dead_code.h
codon/cir/transform/cleanup/global_demote.h
codon/cir/transform/cleanup/replacer.h
codon/cir/transform/folding/const_fold.h
codon/cir/transform/folding/const_prop.h
codon/cir/transform/folding/folding.h
codon/cir/transform/folding/rule.h
codon/cir/transform/lowering/imperative.h
codon/cir/transform/lowering/pipeline.h
codon/parser/ast/types/type.hpp
codon/parser/ast/types/link.hpp
codon/parser/ast/types/class.hpp
codon/parser/ast/types/function.hpp
codon/parser/ast/types/union.hpp
codon/parser/ast/types/static.hpp
codon/parser/ast/types/traits.hpp
codon/parser/cache.hpp
codon/parser/common.hpp
codon/parser/ctx.hpp
codon/parser/peg/peg.hpp
codon/parser/peg/rules.hpp
codon/parser/visitors/doc/doc.hpp
codon/parser/visitors/format/format.hpp
codon/parser/visitors/simplify/simplify.hpp
codon/parser/visitors/simplify/ctx.hpp
codon/parser/visitors/translate/translate.hpp
codon/parser/visitors/translate/translate_ctx.hpp
codon/parser/visitors/typecheck/typecheck.hpp
codon/parser/visitors/typecheck/ctx.hpp
codon/parser/visitors/visitor.hpp
codon/cir/analyze/analysis.hpp
codon/cir/analyze/dataflow/capture.hpp
codon/cir/analyze/dataflow/cfg.hpp
codon/cir/analyze/dataflow/dominator.hpp
codon/cir/analyze/dataflow/reaching.hpp
codon/cir/analyze/module/global_vars.hpp
codon/cir/analyze/module/side_effect.hpp
codon/cir/attribute.hpp
codon/cir/base.hpp
codon/cir/const.hpp
codon/cir/dsl/codegen.hpp
codon/cir/dsl/nodes.hpp
codon/cir/flow.hpp
codon/cir/func.hpp
codon/cir/instr.hpp
codon/cir/llvm/gpu.hpp
codon/cir/llvm/llvisitor.hpp
codon/cir/llvm/llvm.hpp
codon/cir/llvm/optimize.hpp
codon/cir/module.hpp
codon/cir/pyextension.hpp
codon/cir/cir.hpp
codon/cir/transform/cleanup/canonical.hpp
codon/cir/transform/cleanup/dead_code.hpp
codon/cir/transform/cleanup/global_demote.hpp
codon/cir/transform/cleanup/replacer.hpp
codon/cir/transform/folding/const_fold.hpp
codon/cir/transform/folding/const_prop.hpp
codon/cir/transform/folding/folding.hpp
codon/cir/transform/folding/rule.hpp
codon/cir/transform/lowering/imperative.hpp
codon/cir/transform/lowering/pipeline.hpp
codon/cir/transform/manager.h
codon/cir/transform/parallel/openmp.h
codon/cir/transform/parallel/schedule.h
codon/cir/transform/pass.h
codon/cir/transform/pythonic/dict.h
codon/cir/transform/pythonic/generator.h
codon/cir/transform/pythonic/io.h
codon/cir/transform/pythonic/list.h
codon/cir/transform/pythonic/str.h
codon/cir/transform/rewrite.h
codon/cir/types/types.h
codon/cir/util/cloning.h
codon/cir/util/context.h
codon/cir/util/format.h
codon/cir/util/inlining.h
codon/cir/util/irtools.h
codon/cir/util/iterators.h
codon/cir/util/matching.h
codon/cir/util/operator.h
codon/cir/util/outlining.h
codon/cir/util/packs.h
codon/cir/util/side_effect.h
codon/cir/util/visitor.h
codon/cir/value.h
codon/cir/var.h
codon/util/common.h
codon/compiler/jit_extern.h)
codon/cir/transform/parallel/openmp.hpp
codon/cir/transform/parallel/schedule.hpp
codon/cir/transform/pass.hpp
codon/cir/transform/pythonic/dict.hpp
codon/cir/transform/pythonic/generator.hpp
codon/cir/transform/pythonic/io.hpp
codon/cir/transform/pythonic/list.hpp
codon/cir/transform/pythonic/str.hpp
codon/cir/transform/rewrite.hpp
codon/cir/types/types.hpp
codon/cir/util/cloning.hpp
codon/cir/util/format.hpp
codon/cir/util/inlining.hpp
codon/cir/util/irtools.hpp
codon/cir/util/iterators.hpp
codon/cir/util/matching.hpp
codon/cir/util/operator.hpp
codon/cir/util/outlining.hpp
codon/cir/util/packs.hpp
codon/cir/util/side_effect.hpp
codon/cir/util/visitor.hpp
codon/cir/value.hpp
codon/cir/var.hpp
codon/util/common.hpp
codon/compiler/jit_extern.h
)
set(CODON_CPPFILES
codon/compiler/compiler.cpp
codon/compiler/debug_listener.cpp
Expand Down
12 changes: 6 additions & 6 deletions codon/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
#include <unordered_map>
#include <vector>

#include "codon/compiler/compiler.h"
#include "codon/compiler/error.h"
#include "codon/compiler/jit.h"
#include "codon/parser/common.h"
#include "codon/util/common.h"
#include "codon/util/jupyter.h"
#include "codon/compiler/compiler.hpp"
#include "codon/compiler/error.hpp"
#include "codon/compiler/jit.hpp"
#include "codon/parser/common.hpp"
#include "codon/util/common.hpp"
#include "codon/util/jupyter.hpp"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"

Expand Down
2 changes: 1 addition & 1 deletion codon/cir/analyze/analysis.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022-2024 Exaloop Inc. <https://exaloop.io>

#include "analysis.h"
#include "analysis.hpp"

#include "codon/cir/transform/manager.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include <memory>

#include "codon/cir/module.h"
#include "codon/cir/transform/pass.h"
#include "codon/cir/module.hpp"
#include "codon/cir/transform/pass.hpp"

namespace codon {
namespace ir {
Expand Down
8 changes: 4 additions & 4 deletions codon/cir/analyze/dataflow/capture.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright (C) 2022-2024 Exaloop Inc. <https://exaloop.io>

#include "capture.h"
#include "capture.hpp"

#include <algorithm>
#include <iterator>
#include <utility>

#include "codon/cir/analyze/dataflow/reaching.h"
#include "codon/cir/util/irtools.h"
#include "codon/cir/util/side_effect.h"
#include "codon/cir/analyze/dataflow/reaching.hpp"
#include "codon/cir/util/irtools.hpp"
#include "codon/cir/util/side_effect.hpp"

namespace codon {
namespace ir {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#include <unordered_map>
#include <vector>

#include "codon/cir/analyze/analysis.h"
#include "codon/cir/analyze/dataflow/dominator.h"
#include "codon/cir/analyze/dataflow/reaching.h"
#include "codon/cir/cir.h"
#include "codon/cir/analyze/analysis.hpp"
#include "codon/cir/analyze/dataflow/dominator.hpp"
#include "codon/cir/analyze/dataflow/reaching.hpp"
#include "codon/cir/cir.hpp"

namespace codon {
namespace ir {
Expand Down
6 changes: 3 additions & 3 deletions codon/cir/analyze/dataflow/cfg.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (C) 2022-2024 Exaloop Inc. <https://exaloop.io>

#include "cfg.h"
#include "cfg.hpp"

#include <vector>

#include "codon/cir/dsl/codegen.h"
#include "codon/cir/dsl/nodes.h"
#include "codon/cir/dsl/codegen.hpp"
#include "codon/cir/dsl/nodes.hpp"

namespace codon {
namespace ir {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <unordered_map>
#include <unordered_set>

#include "codon/cir/analyze/analysis.h"
#include "codon/cir/cir.h"
#include "codon/cir/util/iterators.h"
#include "codon/cir/analyze/analysis.hpp"
#include "codon/cir/cir.hpp"
#include "codon/cir/util/iterators.hpp"

#define DEFAULT_VISIT(x) \
void visit(const x *v) override { defaultInsert(v); }
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/analyze/dataflow/dominator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022-2024 Exaloop Inc. <https://exaloop.io>

#include "dominator.h"
#include "dominator.hpp"

namespace codon {
namespace ir {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <unordered_map>
#include <utility>

#include "codon/cir/analyze/analysis.h"
#include "codon/cir/analyze/dataflow/cfg.h"
#include "codon/cir/analyze/analysis.hpp"
#include "codon/cir/analyze/dataflow/cfg.hpp"

namespace codon {
namespace ir {
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/analyze/dataflow/reaching.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022-2024 Exaloop Inc. <https://exaloop.io>

#include "reaching.h"
#include "reaching.hpp"

#include <deque>
#include <tuple>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include <utility>

#include "codon/cir/analyze/analysis.h"
#include "codon/cir/analyze/dataflow/cfg.h"
#include "codon/cir/analyze/analysis.hpp"
#include "codon/cir/analyze/dataflow/cfg.hpp"

namespace codon {
namespace ir {
Expand Down
4 changes: 2 additions & 2 deletions codon/cir/analyze/module/global_vars.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (C) 2022-2024 Exaloop Inc. <https://exaloop.io>

#include "global_vars.h"
#include "global_vars.hpp"

#include "codon/cir/util/operator.h"
#include "codon/cir/util/operator.hpp"

namespace codon {
namespace ir {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <unordered_map>

#include "codon/cir/analyze/analysis.h"
#include "codon/cir/analyze/analysis.hpp"

namespace codon {
namespace ir {
Expand Down
8 changes: 4 additions & 4 deletions codon/cir/analyze/module/side_effect.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (C) 2022-2024 Exaloop Inc. <https://exaloop.io>

#include "side_effect.h"
#include "side_effect.hpp"

#include <type_traits>
#include <utility>

#include "codon/cir/analyze/dataflow/capture.h"
#include "codon/cir/util/irtools.h"
#include "codon/cir/util/operator.h"
#include "codon/cir/analyze/dataflow/capture.hpp"
#include "codon/cir/util/irtools.hpp"
#include "codon/cir/util/operator.hpp"

namespace codon {
namespace ir {
Expand Down
Loading