mirror of
https://github.com/exaloop/codon.git
synced 2025-06-03 15:03:52 +08:00
Minor refactor
This commit is contained in:
parent
24df3dce6c
commit
497a111f43
@ -35,7 +35,7 @@ else()
|
||||
set(STATIC_LIBCPP "-static-libstdc++")
|
||||
endif()
|
||||
|
||||
add_executable(peg2cpp codon/util/peg2cpp.cpp codon/util/peglib.h)
|
||||
add_executable(peg2cpp codon/util/peg2cpp.cpp codon/util/cpp-peglib/peglib.h)
|
||||
target_link_libraries(peg2cpp Threads::Threads)
|
||||
add_custom_command(
|
||||
OUTPUT codon_rules.cpp
|
||||
@ -157,7 +157,7 @@ set(CODON_HPPFILES
|
||||
codon/sir/value.h
|
||||
codon/sir/var.h
|
||||
codon/util/common.h
|
||||
codon/util/peglib.h
|
||||
codon/util/cpp-peglib/peglib.h
|
||||
codon/util/fmt/chrono.h
|
||||
codon/util/fmt/color.h
|
||||
codon/util/fmt/compile.h
|
||||
@ -168,7 +168,35 @@ set(CODON_HPPFILES
|
||||
codon/util/fmt/ostream.h
|
||||
codon/util/fmt/posix.h
|
||||
codon/util/fmt/printf.h
|
||||
codon/util/fmt/ranges.h)
|
||||
codon/util/fmt/ranges.h
|
||||
codon/util/semver/semver.h
|
||||
codon/util/toml++/toml.h
|
||||
codon/util/toml++/toml_default_formatter.hpp
|
||||
codon/util/toml++/toml_node.hpp
|
||||
codon/util/toml++/toml_preprocessor.h
|
||||
codon/util/toml++/toml_utf8_streams.hpp
|
||||
codon/util/toml++/toml_array.h
|
||||
codon/util/toml++/toml_formatter.h
|
||||
codon/util/toml++/toml_node_view.h
|
||||
codon/util/toml++/toml_print_to_stream.h
|
||||
codon/util/toml++/toml_value.h
|
||||
codon/util/toml++/toml_array.hpp
|
||||
codon/util/toml++/toml_instantiations.hpp
|
||||
codon/util/toml++/toml_parse_error.h
|
||||
codon/util/toml++/toml_table.h
|
||||
codon/util/toml++/toml_version.h
|
||||
codon/util/toml++/toml_common.h
|
||||
codon/util/toml++/toml_json_formatter.h
|
||||
codon/util/toml++/toml_parse_result.h
|
||||
codon/util/toml++/toml_table.hpp
|
||||
codon/util/toml++/toml_date_time.h
|
||||
codon/util/toml++/toml_json_formatter.hpp
|
||||
codon/util/toml++/toml_parser.h
|
||||
codon/util/toml++/toml_utf8.h
|
||||
codon/util/toml++/toml_default_formatter.h
|
||||
codon/util/toml++/toml_node.h
|
||||
codon/util/toml++/toml_parser.hpp
|
||||
codon/util/toml++/toml_utf8_streams.h)
|
||||
set(CODON_CPPFILES
|
||||
codon/dsl/plugins.cpp
|
||||
codon/parser/ast/expr.cpp
|
||||
|
@ -78,7 +78,8 @@ ProcessResult processSource(const std::vector<const char *> &args) {
|
||||
llvm::cl::desc("Add static variable definitions. The syntax is <name>=<value>"));
|
||||
llvm::cl::list<std::string> disabledOpts(
|
||||
"disable-opt", llvm::cl::desc("Disable the specified IR optimization"));
|
||||
llvm::cl::list<std::string> dsls("dsl", llvm::cl::desc("Use specified DSL"));
|
||||
llvm::cl::list<std::string> plugins("plugin",
|
||||
llvm::cl::desc("Load specified plugin"));
|
||||
|
||||
llvm::cl::ParseCommandLineOptions(args.size(), args.data());
|
||||
|
||||
@ -123,9 +124,9 @@ ProcessResult processSource(const std::vector<const char *> &args) {
|
||||
1000.0);
|
||||
|
||||
// load other plugins
|
||||
for (const auto &dsl : dsls) {
|
||||
for (const auto &plugin : plugins) {
|
||||
std::string errMsg;
|
||||
if (!plm->load(dsl, &errMsg))
|
||||
if (!plm->load(plugin, &errMsg))
|
||||
codon::compilationError(errMsg);
|
||||
}
|
||||
// add all IR passes
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "codon/parser/common.h"
|
||||
#include "codon/parser/peg/rules.h"
|
||||
#include "codon/parser/visitors/format/format.h"
|
||||
#include "codon/util/peglib.h"
|
||||
#include "codon/util/cpp-peglib/peglib.h"
|
||||
|
||||
extern int _ocaml_time;
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "codon/parser/ast.h"
|
||||
#include "codon/parser/cache.h"
|
||||
#include "codon/parser/common.h"
|
||||
#include "codon/util/peglib.h"
|
||||
#include "codon/util/cpp-peglib/peglib.h"
|
||||
|
||||
namespace codon {
|
||||
namespace ast {
|
||||
|
@ -1,5 +1,3 @@
|
||||
|
||||
#include "codon/util/peglib.h"
|
||||
#include <algorithm>
|
||||
#include <any>
|
||||
#include <cassert>
|
||||
@ -22,6 +20,7 @@
|
||||
#include <vector>
|
||||
|
||||
#define FMT_HEADER_ONLY
|
||||
#include "codon/util/cpp-peglib/peglib.h"
|
||||
#include "codon/util/fmt/format.h"
|
||||
|
||||
using namespace std;
|
||||
|
Loading…
x
Reference in New Issue
Block a user