blob: 4fea6baa37955e0b72feae70c3e9d283042f7f04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
// Copyright (C) 2020-2023 Free Software Foundation, Inc.
// This file is part of GCC.
// GCC is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 3, or (at your option) any later
// version.
// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
// You should have received a copy of the GNU General Public License
// along with GCC; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#ifndef RUST_COMPILE_TYPE
#define RUST_COMPILE_TYPE
#include "rust-compile-context.h"
namespace Rust {
namespace Compile {
class TyTyResolveCompile : protected TyTy::TyConstVisitor
{
public:
static tree compile (Context *ctx, const TyTy::BaseType *ty,
bool trait_object_mode = false);
static tree get_implicit_enumeral_node_type (Context *ctx);
void visit (const TyTy::InferType &) override;
void visit (const TyTy::ADTType &) override;
void visit (const TyTy::TupleType &) override;
void visit (const TyTy::FnType &) override;
void visit (const TyTy::FnPtr &) override;
void visit (const TyTy::ArrayType &) override;
void visit (const TyTy::SliceType &) override;
void visit (const TyTy::BoolType &) override;
void visit (const TyTy::IntType &) override;
void visit (const TyTy::UintType &) override;
void visit (const TyTy::FloatType &) override;
void visit (const TyTy::USizeType &) override;
void visit (const TyTy::ISizeType &) override;
void visit (const TyTy::ErrorType &) override;
void visit (const TyTy::CharType &) override;
void visit (const TyTy::ReferenceType &) override;
void visit (const TyTy::PointerType &) override;
void visit (const TyTy::ParamType &) override;
void visit (const TyTy::StrType &) override;
void visit (const TyTy::NeverType &) override;
void visit (const TyTy::PlaceholderType &) override;
void visit (const TyTy::ProjectionType &) override;
void visit (const TyTy::DynamicObjectType &) override;
void visit (const TyTy::ClosureType &) override;
public:
static hashval_t type_hasher (tree type);
protected:
tree create_slice_type_record (const TyTy::SliceType &type);
tree create_str_type_record (const TyTy::StrType &type);
private:
TyTyResolveCompile (Context *ctx, bool trait_object_mode);
Context *ctx;
bool trait_object_mode;
tree translated;
int recurisve_ops;
};
} // namespace Compile
} // namespace Rust
#endif // RUST_COMPILE_TYPE
|