namespace Rust {
namespace HIR {
-BorrowChecker::BorrowChecker () = default;
-
void
BorrowChecker::go (HIR::Crate &crate)
{
class BorrowChecker
{
+ bool enable_dump_bir;
+
public:
- BorrowChecker ();
+ explicit BorrowChecker (bool enable_dump_bir)
+ : enable_dump_bir (enable_dump_bir){};
/** Perform borrow-checking using polonius on an entire crate */
void go (HIR::Crate &crate);
Enum(frust_compile_until) String(const) Value(8)
EnumValue
-Enum(frust_compile_until) String(compilation) Value(9)
+Enum(frust_compile_until) String(borrowcheck) Value(9)
EnumValue
-Enum(frust_compile_until) String(end) Value(10)
+Enum(frust_compile_until) String(compilation) Value(10)
+
+EnumValue
+Enum(frust_compile_until) String(end) Value(11)
frust-name-resolution-2.0
Rust Var(flag_name_resolution_2_0)
#include "selftest.h"
#include "tm.h"
#include "rust-target.h"
+#include "rust-borrow-checker.h"
extern bool
saw_errors (void);
"dump option was not given a name. choose %<lex%>, %<ast-pretty%>, "
"%<register_plugins%>, %<injection%>, "
"%<expansion%>, %<resolution%>, %<target_options%>, %<hir%>, "
- "%<hir-pretty%>, or %<all%>");
+ "%<hir-pretty%>, %<bir%> or %<all%>");
return false;
}
{
options.enable_dump_option (CompileOptions::HIR_DUMP_PRETTY);
}
+ else if (arg == "bir")
+ {
+ options.enable_dump_option (CompileOptions::BIR_DUMP);
+ }
else
{
rust_error_at (
HIR::ConstChecker ().go (hir);
+ if (last_step == CompileOptions::CompileStep::BorrowCheck)
+ return;
+
+ const bool dump_bir
+ = options.dump_option_enabled (CompileOptions::DumpOption::BIR_DUMP);
+ HIR::BorrowChecker (dump_bir).go (hir);
+
if (saw_errors ())
return;
TARGET_OPTION_DUMP,
HIR_DUMP,
HIR_DUMP_PRETTY,
+ BIR_DUMP,
};
std::set<DumpOption> dump_options;
Privacy,
Unsafety,
Const,
+ BorrowCheck,
Compilation,
End,
} compile_until
enable_dump_option (DumpOption::TARGET_OPTION_DUMP);
enable_dump_option (DumpOption::HIR_DUMP);
enable_dump_option (DumpOption::HIR_DUMP_PRETTY);
+ enable_dump_option (DumpOption::BIR_DUMP);
}
void set_crate_name (std::string name)