Skip to content

Commit

Permalink
Changes to some .h files into .hpp files for modernisation
Browse files Browse the repository at this point in the history
  • Loading branch information
JustCallMeRay committed Nov 30, 2024
1 parent d13d6a5 commit f6063c0
Show file tree
Hide file tree
Showing 89 changed files with 189 additions and 188 deletions.
21 changes: 11 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ set(CODON_JUPYTER_FILES codon/util/jupyter.h 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 @@ -130,7 +130,7 @@ set(CODON_HPPFILES
codon/compiler/memory_manager.h
codon/dsl/dsl.h
codon/dsl/plugins.h
codon/parser/ast.h
codon/parser/ast.hpp
codon/parser/ast/expr.h
codon/parser/ast/stmt.h
codon/parser/ast/types.h
Expand All @@ -141,19 +141,19 @@ set(CODON_HPPFILES
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/cache.hpp
codon/parser/common.hpp
codon/parser/ctx.hpp
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/simplify/ctx.hpp
codon/parser/visitors/translate/translate.h
codon/parser/visitors/translate/translate_ctx.h
codon/parser/visitors/translate/translate_ctx.hpp
codon/parser/visitors/typecheck/typecheck.h
codon/parser/visitors/typecheck/ctx.h
codon/parser/visitors/typecheck/ctx.hpp
codon/parser/visitors/visitor.h
codon/cir/analyze/analysis.h
codon/cir/analyze/dataflow/capture.h
Expand Down Expand Up @@ -212,8 +212,9 @@ set(CODON_HPPFILES
codon/cir/util/visitor.h
codon/cir/value.h
codon/cir/var.h
codon/util/common.h
codon/compiler/jit_extern.h)
codon/util/common.hpp
codon/compiler/jit_extern.h
)
set(CODON_CPPFILES
codon/compiler/compiler.cpp
codon/compiler/debug_listener.cpp
Expand Down
4 changes: 2 additions & 2 deletions codon/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#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/parser/common.hpp"
#include "codon/util/common.hpp"
#include "codon/util/jupyter.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <unordered_map>
#include <utility>

#include "codon/util/common.h"
#include "codon/util/common.hpp"

namespace codon {
namespace ir {
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "codon/cir/attribute.h"
#include "codon/cir/util/iterators.h"
#include "codon/cir/util/visitor.h"
#include "codon/util/common.h"
#include "codon/util/common.hpp"
#include <fmt/format.h>
#include <fmt/ostream.h>

Expand Down
2 changes: 1 addition & 1 deletion codon/cir/func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "codon/cir/util/operator.h"
#include "codon/cir/util/visitor.h"
#include "codon/cir/var.h"
#include "codon/parser/common.h"
#include "codon/parser/common.hpp"

namespace codon {
namespace ir {
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/llvm/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <memory>
#include <string>

#include "codon/util/common.h"
#include "codon/util/common.hpp"

namespace codon {
namespace ir {
Expand Down
6 changes: 3 additions & 3 deletions codon/cir/llvm/llvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#include "codon/cir/util/irtools.h"
#include "codon/compiler/debug_listener.h"
#include "codon/compiler/memory_manager.h"
#include "codon/parser/common.h"
#include "codon/runtime/lib.h"
#include "codon/util/common.h"
#include "codon/parser/common.hpp"
#include "codon/runtime/lib.hpp"
#include "codon/util/common.hpp"

namespace codon {
namespace ir {
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/llvm/llvisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "codon/cir/llvm/llvm.h"
#include "codon/cir/pyextension.h"
#include "codon/dsl/plugins.h"
#include "codon/util/common.h"
#include "codon/util/common.hpp"

#include <string>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/llvm/optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <deque>

#include "codon/cir/llvm/gpu.h"
#include "codon/util/common.h"
#include "codon/util/common.hpp"

static llvm::codegen::RegisterCodeGenFlags CFG;

Expand Down
2 changes: 1 addition & 1 deletion codon/cir/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <memory>

#include "codon/cir/func.h"
#include "codon/parser/cache.h"
#include "codon/parser/cache.hpp"

namespace codon {
namespace ir {
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "codon/cir/util/iterators.h"
#include "codon/cir/value.h"
#include "codon/cir/var.h"
#include "codon/util/common.h"
#include "codon/util/common.hpp"
#include <fmt/format.h>
#include <fmt/ostream.h>

Expand Down
2 changes: 1 addition & 1 deletion codon/cir/transform/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "codon/cir/transform/pythonic/io.h"
#include "codon/cir/transform/pythonic/list.h"
#include "codon/cir/transform/pythonic/str.h"
#include "codon/util/common.h"
#include "codon/util/common.hpp"

namespace codon {
namespace ir {
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/types/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "codon/cir/util/iterators.h"
#include "codon/cir/util/visitor.h"
#include "codon/cir/value.h"
#include "codon/parser/cache.h"
#include "codon/parser/cache.hpp"
#include <fmt/format.h>

namespace codon {
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/types/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "codon/cir/base.h"
#include "codon/cir/util/packs.h"
#include "codon/cir/util/visitor.h"
#include "codon/parser/ast.h"
#include "codon/parser/ast.hpp"
#include <fmt/format.h>
#include <fmt/ostream.h>

Expand Down
2 changes: 1 addition & 1 deletion codon/cir/var.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "codon/cir/types/types.h"
#include "codon/cir/value.h"
#include "codon/util/common.h"
#include "codon/util/common.hpp"
#include <fmt/format.h>
#include <fmt/ostream.h>

Expand Down
2 changes: 1 addition & 1 deletion codon/compiler/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "compiler.h"

#include "codon/compiler/error.h"
#include "codon/parser/cache.h"
#include "codon/parser/cache.hpp"
#include "codon/parser/peg/peg.h"
#include "codon/parser/visitors/doc/doc.h"
#include "codon/parser/visitors/format/format.h"
Expand Down
2 changes: 1 addition & 1 deletion codon/compiler/debug_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <functional>
#include <sstream>

#include "codon/runtime/lib.h"
#include "codon/runtime/lib.hpp"

namespace codon {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion codon/compiler/jit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <sstream>

#include "codon/parser/common.h"
#include "codon/parser/common.hpp"
#include "codon/parser/peg/peg.h"
#include "codon/parser/visitors/doc/doc.h"
#include "codon/parser/visitors/format/format.h"
Expand Down
4 changes: 2 additions & 2 deletions codon/compiler/jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "codon/compiler/compiler.h"
#include "codon/compiler/engine.h"
#include "codon/compiler/error.h"
#include "codon/parser/cache.h"
#include "codon/runtime/lib.h"
#include "codon/parser/cache.hpp"
#include "codon/runtime/lib.hpp"

#include "codon/compiler/jit_extern.h"

Expand Down
2 changes: 1 addition & 1 deletion codon/compiler/memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "memory_manager.h"

#include "codon/runtime/lib.h"
#include "codon/runtime/lib.hpp"

namespace codon {

Expand Down
4 changes: 2 additions & 2 deletions codon/dsl/plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <semver.hpp>
#include <toml++/toml.h>

#include "codon/parser/common.h"
#include "codon/util/common.h"
#include "codon/parser/common.hpp"
#include "codon/util/common.hpp"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions codon/parser/ast/expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <string>
#include <vector>

#include "codon/parser/ast.h"
#include "codon/parser/cache.h"
#include "codon/parser/ast.hpp"
#include "codon/parser/cache.hpp"
#include "codon/parser/visitors/visitor.h"

#define FASTFLOAT_ALLOWS_LEADING_PLUS
Expand Down
2 changes: 1 addition & 1 deletion codon/parser/ast/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <vector>

#include "codon/parser/ast/types.h"
#include "codon/parser/common.h"
#include "codon/parser/common.hpp"

namespace codon::ast {

Expand Down
2 changes: 1 addition & 1 deletion codon/parser/ast/stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <utility>
#include <vector>

#include "codon/parser/cache.h"
#include "codon/parser/cache.hpp"
#include "codon/parser/visitors/visitor.h"

#define ACCEPT_IMPL(T, X) \
Expand Down
2 changes: 1 addition & 1 deletion codon/parser/ast/stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "codon/parser/ast/expr.h"
#include "codon/parser/ast/types.h"
#include "codon/parser/common.h"
#include "codon/parser/common.hpp"

namespace codon::ast {

Expand Down
6 changes: 3 additions & 3 deletions codon/parser/ast/types/static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include <string>
#include <vector>

#include "codon/parser/ast.h"
#include "codon/parser/ast.hpp"
#include "codon/parser/ast/types/static.h"
#include "codon/parser/cache.h"
#include "codon/parser/common.h"
#include "codon/parser/cache.hpp"
#include "codon/parser/common.hpp"
#include "codon/parser/visitors/format/format.h"
#include "codon/parser/visitors/typecheck/typecheck.h"

Expand Down
4 changes: 2 additions & 2 deletions codon/parser/ast/types/traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <string>
#include <vector>

#include "codon/parser/ast.h"
#include "codon/parser/cache.h"
#include "codon/parser/ast.hpp"
#include "codon/parser/cache.hpp"
#include "codon/parser/visitors/typecheck/typecheck.h"

namespace codon::ast::types {
Expand Down
2 changes: 1 addition & 1 deletion codon/parser/ast/types/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <unordered_map>
#include <vector>

#include "codon/parser/common.h"
#include "codon/parser/common.hpp"

namespace codon::ast {
struct Cache;
Expand Down
4 changes: 2 additions & 2 deletions codon/parser/ast/types/union.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <string>
#include <vector>

#include "codon/parser/ast.h"
#include "codon/parser/cache.h"
#include "codon/parser/ast.hpp"
#include "codon/parser/cache.hpp"
#include "codon/parser/visitors/typecheck/typecheck.h"

namespace codon::ast::types {
Expand Down
6 changes: 3 additions & 3 deletions codon/parser/cache.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Copyright (C) 2022-2024 Exaloop Inc. <https://exaloop.io>

#include "cache.h"
#include "cache.hpp"

#include <chrono>
#include <string>
#include <vector>

#include "codon/cir/pyextension.h"
#include "codon/cir/util/irtools.h"
#include "codon/parser/common.h"
#include "codon/parser/common.hpp"
#include "codon/parser/peg/peg.h"
#include "codon/parser/visitors/simplify/simplify.h"
#include "codon/parser/visitors/translate/translate.h"
#include "codon/parser/visitors/typecheck/ctx.h"
#include "codon/parser/visitors/typecheck/ctx.hpp"
#include "codon/parser/visitors/typecheck/typecheck.h"

namespace codon::ast {
Expand Down
6 changes: 3 additions & 3 deletions codon/parser/cache.h → codon/parser/cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#include "codon/cir/cir.h"
#include "codon/cir/pyextension.h"
#include "codon/parser/ast.h"
#include "codon/parser/common.h"
#include "codon/parser/ctx.h"
#include "codon/parser/ast.hpp"
#include "codon/parser/common.hpp"
#include "codon/parser/ctx.hpp"

#define FILE_GENERATED "<generated>"
#define MODULE_MAIN "__main__"
Expand Down
2 changes: 1 addition & 1 deletion codon/parser/common.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 "common.h"
#include "common.hpp"

#include <cinttypes>
#include <climits>
Expand Down
2 changes: 1 addition & 1 deletion codon/parser/common.h → codon/parser/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <utility>
#include <vector>

#include "codon/util/common.h"
#include "codon/util/common.hpp"

#define CAST(s, T) dynamic_cast<T *>(s.get())

Expand Down
4 changes: 2 additions & 2 deletions codon/parser/ctx.h → codon/parser/ctx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <unordered_set>
#include <vector>

#include "codon/parser/ast.h"
#include "codon/parser/common.h"
#include "codon/parser/ast.hpp"
#include "codon/parser/common.hpp"

namespace codon::ast {

Expand Down
Loading

0 comments on commit f6063c0

Please sign in to comment.