]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add call to ast validation checker
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 24 Oct 2023 14:46:21 +0000 (16:46 +0200)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 6 Nov 2023 17:13:22 +0000 (17:13 +0000)
Add call to ast validation check, also add appropriate step to this pass
and the feature gating.

gcc/rust/ChangeLog:

* rust-session-manager.cc (Session::compile_crate): Add call to ast
validation.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/rust-session-manager.cc

index c18a3d01bd94bf9afb649d53553217fdd0c2c826..33aa13364807f3d32ebbdb1b34116df5fb55ee28 100644 (file)
@@ -47,6 +47,7 @@
 #include "rust-unicode.h"
 #include "rust-attribute-values.h"
 #include "rust-borrow-checker.h"
+#include "rust-ast-validation.h"
 
 #include "input.h"
 #include "selftest.h"
@@ -600,7 +601,15 @@ Session::compile_crate (const char *filename)
       rust_debug ("END POST-EXPANSION AST DUMP");
     }
 
+  // AST Validation pass
+  if (last_step == CompileOptions::CompileStep::ASTValidation)
+    return;
+
+  ASTValidation ().check (parsed_crate);
+
   // feature gating
+  if (last_step == CompileOptions::CompileStep::FeatureGating)
+    return;
   FeatureGate ().check (parsed_crate);
 
   if (last_step == CompileOptions::CompileStep::NameResolution)