Skip to content

Commit

Permalink
Update to latest trieste version (#647)
Browse files Browse the repository at this point in the history
* Update to latest trieste version

This reduces the compile time by around 20% as the latest Trieste does
not include CPP::CLI in the main header.
  • Loading branch information
mjp41 authored Nov 27, 2023
1 parent d8d30ed commit 0cd9a3b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(TRIESTE_BUILD_SAMPLES OFF)
FetchContent_Declare(
trieste
GIT_REPOSITORY https://github.com/microsoft/trieste
GIT_TAG main
GIT_TAG 0b2ec3c5ea7bf52b0f6b2ed9e4f9d571aba47a8b
GIT_SHALLOW TRUE
)

Expand Down
30 changes: 12 additions & 18 deletions src/lang.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,23 +268,17 @@ namespace verona
return opts;
}

Driver& driver()
{
static Driver d(
"Verona",
&options(),
parser(),
{
modules(), structure(), reference(), conditionals(),
lambda(), autocreate(), defaultargs(), typenames(),
typeview(), typefunc(), typealg(), typeflat(),
typevalid(), typereference(), codereuse(), memberconflict(),
resetimplicit(), reverseapp(), application(), assignlhs(),
localvar(), assignment(), autofields(), autorhs(),
partialapp(), traitisect(), nlrcheck(), anf(),
defbeforeuse(), drop(), validtypeargs(), // typeinfer(),
});

return d;
std::vector<Pass> passes()
{
return {
modules(), structure(), reference(), conditionals(),
lambda(), autocreate(), defaultargs(), typenames(),
typeview(), typefunc(), typealg(), typeflat(),
typevalid(), typereference(), codereuse(), memberconflict(),
resetimplicit(), reverseapp(), application(), assignlhs(),
localvar(), assignment(), autofields(), autorhs(),
partialapp(), traitisect(), nlrcheck(), anf(),
defbeforeuse(), drop(), validtypeargs(), // typeinfer(),
};
}
}
9 changes: 3 additions & 6 deletions src/lang.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: MIT
#pragma once

#include <trieste/driver.h>
#include <trieste/trieste.h>

namespace verona
{
Expand Down Expand Up @@ -271,12 +271,9 @@ namespace verona
{
bool no_std = false;

void configure(CLI::App& cli) override
{
cli.add_flag("--no-std", no_std, "Don't import the standard library.");
}
void configure(CLI::App& cli) override;
};

Options& options();
Driver& driver();
std::vector<Pass> passes();
}
14 changes: 13 additions & 1 deletion src/main.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
// Copyright Microsoft and Project Verona Contributors.
// SPDX-License-Identifier: MIT
#include "lang.h"
#include "trieste/driver.h"

namespace verona
{
void Options::configure(CLI::App& cli)
{
cli.add_flag("--no-std", no_std, "Don't import the standard library.");
}
}

int main(int argc, char** argv)
{
return verona::driver().run(argc, argv);
trieste::Driver d(
"Verona", &verona::options(), verona::parser(), verona::passes());

return d.run(argc, argv);
}

0 comments on commit 0cd9a3b

Please sign in to comment.