-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathyuc.h
More file actions
47 lines (38 loc) · 868 Bytes
/
yuc.h
File metadata and controls
47 lines (38 loc) · 868 Bytes
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
#ifndef YUC_H
#define YUC_H
#include <string>
#include <fstream>
#include <iostream>
using namespace std;
namespace yuc {
enum LinkageTypes {
ExternalLinkage = 0, AvailableExternallyLinkage, LinkOnceAnyLinkage, LinkOnceODRLinkage,
WeakAnyLinkage, WeakODRLinkage, AppendingLinkage, InternalLinkage,
PrivateLinkage, ExternalWeakLinkage, CommonLinkage
};
typedef enum {
ArrayType = 0, TypedPointerType, FunctionType, IntegerType,
PointerType, StructType, VectorType
} CTypeKind;
struct CType {
CTypeKind kind;
int size;
bool is_unsigned;
};
struct CValue {
int64_t val;
};
struct Ast {
bool is_function;
bool is_static;
string name;
int align;
Ast *next;
LinkageTypes linkage_type;
bool is_preemptable;
CType *type;
CValue *initializer;
};
void ir_gen(Ast *ast, ofstream &out, const string &moduleName);
}
#endif