Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup clang warnings #3244

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions gcc/rust/ast/rust-expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4810,14 +4810,14 @@ class InlineAsmOperand
rust_assert (this->expr != nullptr);
}

In (const struct In &other)
In (const In &other)
{
reg = other.reg;

expr = other.expr->clone_expr ();
}

In operator= (const struct In &other)
In operator= (const In &other)
{
reg = other.reg;
expr = other.expr->clone_expr ();
Expand All @@ -4843,14 +4843,14 @@ class InlineAsmOperand
rust_assert (this->expr != nullptr);
}

Out (const struct Out &other)
Out (const Out &other)
{
reg = other.reg;
late = other.late;
expr = other.expr->clone_expr ();
}

Out operator= (const struct Out &other)
Out operator= (const Out &other)
{
reg = other.reg;
late = other.late;
Expand All @@ -4876,14 +4876,14 @@ class InlineAsmOperand
rust_assert (this->expr != nullptr);
}

InOut (const struct InOut &other)
InOut (const InOut &other)
{
reg = other.reg;
late = other.late;
expr = other.expr->clone_expr ();
}

InOut operator= (const struct InOut &other)
InOut operator= (const InOut &other)
{
reg = other.reg;
late = other.late;
Expand Down Expand Up @@ -4913,15 +4913,15 @@ class InlineAsmOperand
rust_assert (this->out_expr != nullptr);
}

SplitInOut (const struct SplitInOut &other)
SplitInOut (const SplitInOut &other)
{
reg = other.reg;
late = other.late;
in_expr = other.in_expr->clone_expr ();
out_expr = other.out_expr->clone_expr ();
}

SplitInOut operator= (const struct SplitInOut &other)
SplitInOut operator= (const SplitInOut &other)
{
reg = other.reg;
late = other.late;
Expand Down Expand Up @@ -4953,12 +4953,12 @@ class InlineAsmOperand
{
rust_assert (this->expr != nullptr);
}
Sym (const struct Sym &other)
Sym (const Sym &other)
{
expr = std::unique_ptr<Expr> (other.expr->clone_expr ());
}

Sym operator= (const struct Sym &other)
Sym operator= (const Sym &other)
{
expr = std::unique_ptr<Expr> (other.expr->clone_expr ());
return *this;
Expand All @@ -4981,12 +4981,12 @@ class InlineAsmOperand
if (label_name.has_value ())
this->label_name = label_name.value ();
}
Label (const struct Label &other)
Label (const Label &other)
{
expr = std::unique_ptr<Expr> (other.expr->clone_expr ());
}

Label operator= (const struct Label &other)
Label operator= (const Label &other)
{
expr = std::unique_ptr<Expr> (other.expr->clone_expr ());
return *this;
Expand Down
5 changes: 2 additions & 3 deletions gcc/rust/backend/rust-compile-asm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
namespace Rust {
namespace Compile {

CompileAsm::CompileAsm (Context *ctx)
: HIRCompileBase (ctx), translated (error_mark_node)
{}
CompileAsm::CompileAsm (Context *ctx) : HIRCompileBase (ctx) {}

tree
CompileAsm::tree_codegen_asm (HIR::InlineAsm &expr)
{
Expand Down
2 changes: 0 additions & 2 deletions gcc/rust/backend/rust-compile-asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ namespace Compile {
class CompileAsm : private HIRCompileBase
{
private:
tree translated;

// RELEVANT MEMBER FUNCTIONS

// The limit is 5 because it stands for the 5 things that the C version of
Expand Down
2 changes: 1 addition & 1 deletion gcc/rust/checks/errors/rust-unsafe-checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class UnsafeChecker : public HIRFullVisitor
virtual void visit (MatchExpr &expr) override;
virtual void visit (AwaitExpr &expr) override;
virtual void visit (AsyncBlockExpr &expr) override;
virtual void visit (InlineAsm &expr);
virtual void visit (InlineAsm &expr) override;
virtual void visit (TypeParam &param) override;
virtual void visit (ConstGenericParam &param) override;
virtual void visit (LifetimeWhereClauseItem &item) override;
Expand Down
4 changes: 2 additions & 2 deletions gcc/rust/hir/tree/rust-hir-expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3700,7 +3700,6 @@ struct AnonConst
return *this;
}
};
;

class InlineAsmOperand
{
Expand Down Expand Up @@ -3888,7 +3887,6 @@ class InlineAsmOperand
tl::optional<struct Const> cnst;
tl::optional<struct Sym> sym;
tl::optional<struct Label> label;
location_t locus;

public:
InlineAsmOperand (const InlineAsmOperand &other)
Expand Down Expand Up @@ -3931,6 +3929,7 @@ class InlineAsmOperand
struct Sym get_sym () const { return sym.value (); }
struct Label get_label () const { return label.value (); }
};

// Inline Assembly Node
class InlineAsm : public ExprWithoutBlock
{
Expand Down Expand Up @@ -4009,6 +4008,7 @@ class InlineAsm : public ExprWithoutBlock

{}
};

} // namespace HIR
} // namespace Rust

Expand Down
2 changes: 1 addition & 1 deletion gcc/rust/hir/tree/rust-hir.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ class LifetimeParam : public GenericParam
// Returns whether the lifetime param has an outer attribute.
bool has_outer_attribute () const override { return outer_attrs.size () > 1; }

AST::AttrVec &get_outer_attrs () { return outer_attrs; }
AST::AttrVec &get_outer_attrs () override { return outer_attrs; }

// Returns whether the lifetime param is in an error state.
bool is_error () const { return lifetime.is_error (); }
Expand Down
4 changes: 1 addition & 3 deletions gcc/rust/typecheck/rust-tyty-call.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,12 @@ class TypeCheckCallExpr : private TyVisitor
TypeCheckCallExpr (HIR::CallExpr &c, TyTy::VariantDef &variant,
Resolver::TypeCheckContext *context)
: resolved (new TyTy::ErrorType (c.get_mappings ().get_hirid ())), call (c),
variant (variant), context (context),
mappings (Analysis::Mappings::get ())
variant (variant), mappings (Analysis::Mappings::get ())
{}

BaseType *resolved;
HIR::CallExpr &call;
TyTy::VariantDef &variant;
Resolver::TypeCheckContext *context;
Analysis::Mappings &mappings;
};

Expand Down
Loading