-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfield.cpp
43 lines (37 loc) · 922 Bytes
/
field.cpp
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
#include <iostream>
#include <vector>
#include <gcc-plugin.h>
#include <coretypes.h>
#include <tree.h>
#include "field.hpp"
#include "tree-nodes/field_decl.hpp"
#include "owl/struct.hpp"
void
Field::process (tree f)
{
name =
call_type_ret < TC_FIELD_DECL, const char *>(f,
TC_FIELD_DECL::
finish_type_field);
offset =
call_type_ret < TC_FIELD_DECL, long unsigned int >(f,
TC_FIELD_DECL::
get_offset);
bit_offset =
call_type_ret < TC_FIELD_DECL, long unsigned int >(f,
TC_FIELD_DECL::
get_bit_offset);
bit_size =
call_type_ret < TC_FIELD_DECL, long unsigned int >(f,
TC_FIELD_DECL::
get_bit_size);
bit_field =
call_type_ret < TC_FIELD_DECL, bool > (f, TC_FIELD_DECL::get_bit_field);
}
namespace gcc
{
template<> void Struct::field_begin (Field fld)
{
FieldDecl f (fld, this);
}
}