Repository navigation
Expand file tree
/
Copy pathverify.h
More file actions
62 lines (53 loc) · 1.64 KB
/
Copy pathverify.h
File metadata and controls
62 lines (53 loc) · 1.64 KB
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
#ifndef RAT_PASS_VERIFY_H
#define RAT_PASS_VERIFY_H
#include "core.h"
#include "ir/opcode.h"
#include "pass/pass.h"
#include <iosfwd>
namespace rat {
struct Node;
struct Type;
struct VerifyPass : Pass {
explicit VerifyPass(std::ostream& os);
B32 run(Module& module, const TargetInfo& target) override;
struct FunctionVerifier {
const Function& fn;
std::ostream& os;
Set<const Node*> inFn;
static String vref(const Node* n);
void run();
void err(const Node* n, const String& msg);
B32 require(B32 ok, const Node* n, const C8* msg);
static B32 isCtrl(const Node* n);
static B32 isBool(const Type* t);
static B32 listsAsInput(const Node* user, const Node* def);
B32 checkArity(const Node* n);
void checkEdges(Node* n);
void checkNode(Node* n);
void checkCtrlMem(const Node* n, const C8* what);
B32 checkTuple(const Node* n, const C8* op, U32 len, const C8* by);
void checkStart(const Node* n);
void checkReturn(const Node* n);
void checkRegion(const Node* n);
void checkIf(const Node* n);
void checkSwitch(const Node* n);
void checkProj(const Node* n);
void checkPhi(const Node* n);
void checkLaneOp(const Node* n);
void checkSelect(const Node* n);
void checkMemoryOp(const Node* n);
void checkCall(const Node* n);
void checkAsm(const Node* n);
void checkArithmetic(const Node* n);
void checkCompare(const Node* n);
void checkBinary(const Node* n);
static B32 hasVectorLowering(Opcode op, const Type* et);
void checkUnary(const Node* n);
void checkConvert(const Node* n);
void checkStopReturns();
};
private:
std::ostream* os;
};
} // namespace rat
#endif