diff options
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/backend/rust-compile-block.h | 2 | ||||
-rw-r--r-- | gcc/rust/backend/rust-compile-expr.cc | 4 | ||||
-rw-r--r-- | gcc/rust/backend/rust-compile-expr.h | 1 | ||||
-rw-r--r-- | gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc | 5 | ||||
-rw-r--r-- | gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.h | 1 | ||||
-rw-r--r-- | gcc/rust/checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h | 2 | ||||
-rw-r--r-- | gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc | 6 | ||||
-rw-r--r-- | gcc/rust/checks/errors/privacy/rust-privacy-reporter.h | 1 | ||||
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-expr.h | 10 | ||||
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-visitor.h | 1 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-expr.cc | 6 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-expr.h | 1 |
12 files changed, 40 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-block.h b/gcc/rust/backend/rust-compile-block.h index b315c77..d226b4b 100644 --- a/gcc/rust/backend/rust-compile-block.h +++ b/gcc/rust/backend/rust-compile-block.h @@ -101,6 +101,7 @@ public: void visit (HIR::MatchExpr &) override {} void visit (HIR::AwaitExpr &) override {} void visit (HIR::AsyncBlockExpr &) override {} + void visit (HIR::InlineAsm &) override {} private: CompileConditionalBlocks (Context *ctx, Bvariable *result) @@ -184,6 +185,7 @@ public: void visit (HIR::MatchExpr &) override {} void visit (HIR::AwaitExpr &) override {} void visit (HIR::AsyncBlockExpr &) override {} + void visit (HIR::InlineAsm &) override {} private: CompileExprWithBlock (Context *ctx, Bvariable *result) diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index e2fa6dd..e23c691 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -319,6 +319,10 @@ CompileExpr::visit (HIR::IfExpr &expr) } void +CompileExpr::visit (HIR::InlineAsm &expr) +{} + +void CompileExpr::visit (HIR::IfExprConseqElse &expr) { TyTy::BaseType *if_type = nullptr; diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h index b257da5..ef907d1 100644 --- a/gcc/rust/backend/rust-compile-expr.h +++ b/gcc/rust/backend/rust-compile-expr.h @@ -68,6 +68,7 @@ public: void visit (HIR::RangeFullExpr &expr) override; void visit (HIR::RangeFromToInclExpr &expr) override; void visit (HIR::ClosureExpr &expr) override; + void visit (HIR::InlineAsm &expr) override; // TODO void visit (HIR::ErrorPropagationExpr &) override {} diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc index 3515bdf..8d4d90a 100644 --- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc +++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.cc @@ -21,6 +21,7 @@ #include "rust-bir-builder-lazyboolexpr.h" #include "rust-bir-builder-pattern.h" #include "rust-bir-builder-struct.h" +#include "rust-hir-expr.h" namespace Rust { namespace BIR { @@ -318,6 +319,10 @@ ExprStmtBuilder::visit (HIR::CallExpr &expr) } void +ExprStmtBuilder::visit (HIR::InlineAsm &expr) +{} + +void ExprStmtBuilder::visit (HIR::MethodCallExpr &expr) {} diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.h index 3a58611..574f0f3 100644 --- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.h +++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-expr-stmt.h @@ -99,6 +99,7 @@ protected: // Expr void visit (HIR::WhileLetLoopExpr &expr) override; void visit (HIR::IfExpr &expr) override; void visit (HIR::IfExprConseqElse &expr) override; + void visit (HIR::InlineAsm &expr) override; void visit (HIR::IfLetExpr &expr) override; void visit (HIR::IfLetExprConseqElse &expr) override; diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h index 3f46d57..8c1cd44 100644 --- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h +++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h @@ -213,6 +213,8 @@ public: return_place (ExprStmtBuilder (ctx).build (expr), expr.get_locus ()); } + void visit (HIR::InlineAsm &expr) override {} + protected: // Illegal at this position. void visit (HIR::StructExprFieldIdentifier &field) override { diff --git a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc index d16d6ed..2e810bf 100644 --- a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc +++ b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc @@ -284,6 +284,12 @@ PrivacyReporter::visit (HIR::TypePathSegmentFunction &) } void +PrivacyReporter::visit (HIR::InlineAsm &) +{ + return; +} + +void PrivacyReporter::visit (HIR::TypePath &path) { check_for_privacy_violation (path.get_mappings ().get_nodeid (), diff --git a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.h b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.h index 6f2937c..c4f94ab 100644 --- a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.h +++ b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.h @@ -126,6 +126,7 @@ types virtual void visit (HIR::MatchExpr &expr); virtual void visit (HIR::AwaitExpr &expr); virtual void visit (HIR::AsyncBlockExpr &expr); + virtual void visit (HIR::InlineAsm &expr); virtual void visit (HIR::EnumItemTuple &); virtual void visit (HIR::EnumItemStruct &); diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h index 5d2cdd1..7b2e32e 100644 --- a/gcc/rust/hir/tree/rust-hir-expr.h +++ b/gcc/rust/hir/tree/rust-hir-expr.h @@ -4162,6 +4162,16 @@ public: options (std::move (options)) {} + + // This function checks if the assembly macro is "simple" or not, according to + // the tree defition (tree.h) of the + bool is_simple () + { + return operands.size () == 0 && clobber_abi.size () == 0 + && options.size () == 0; + } + + bool is_inline_asm () { return !is_global_asm; } }; } // namespace HIR } // namespace Rust diff --git a/gcc/rust/hir/tree/rust-hir-visitor.h b/gcc/rust/hir/tree/rust-hir-visitor.h index 72609f4..e69e951 100644 --- a/gcc/rust/hir/tree/rust-hir-visitor.h +++ b/gcc/rust/hir/tree/rust-hir-visitor.h @@ -450,6 +450,7 @@ public: virtual void visit (IfExprConseqElse &expr) = 0; virtual void visit (IfLetExpr &expr) = 0; virtual void visit (IfLetExprConseqElse &expr) = 0; + virtual void visit (InlineAsm &expr) = 0; virtual void visit (MatchExpr &expr) = 0; virtual void visit (AwaitExpr &expr) = 0; virtual void visit (AsyncBlockExpr &expr) = 0; diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc index 38734d5..6635f13 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc @@ -776,6 +776,12 @@ TypeCheckExpr::visit (HIR::RangeToExpr &expr) } void +TypeCheckExpr::visit (HIR::InlineAsm &expr) +{ + return; +} + +void TypeCheckExpr::visit (HIR::RangeFullExpr &expr) { auto lang_item_type = LangItem::Kind::RANGE_FULL; diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.h b/gcc/rust/typecheck/rust-hir-type-check-expr.h index 45fc330..7192cf4 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.h +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h @@ -71,6 +71,7 @@ public: void visit (HIR::RangeFromToInclExpr &expr) override; void visit (HIR::WhileLoopExpr &expr) override; void visit (HIR::ClosureExpr &expr) override; + void visit (HIR::InlineAsm &expr) override; // TODO void visit (HIR::ErrorPropagationExpr &) override {} |