-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInsertionPointMsg.cc
More file actions
142 lines (124 loc) · 4.44 KB
/
InsertionPointMsg.cc
File metadata and controls
142 lines (124 loc) · 4.44 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//
// Copyright ©2017 NagraFrance
//
#include "InsertionPointMsg.h"
cpad::insns::InsertionPointRequestHelper::InsertionPointRequestHelper(std::string cunit_name,
std::string cfun_name,
cpad::insns::InsertionLocation location)
: ::cpad::insns::InsertionPointRequest()
{
set_cunit_name(cunit_name);
set_cfun_name(cfun_name);
set_location(location);
}
cpad::insns::InsertionPointRequestHelper::InsertionPointRequestHelper(const char *buffer)
: ::cpad::insns::InsertionPointRequest()
{
ParseFromString(std::string(buffer));
}
cpad::insns::InsertionPointRequestHelper::InsertionPointRequestHelper(const ::cpad::insns::InsertionPointRequest *request)
: ::cpad::insns::InsertionPointRequest(*request)
{
}
cpad::insns::InsertionPointRequestHelper::~InsertionPointRequestHelper()
{
}
cpad::insns::InsertionPointRequestHelper::InsertionPointRequestHelper(cpad::insns::InsertionPointRequestHelper const&a_copy)
: ::cpad::insns::InsertionPointRequestHelper(a_copy.cunit_name(),
a_copy.cfun_name(),
a_copy.location())
{
}
cpad::insns::InsertionPointRequestHelper&
cpad::insns::InsertionPointRequestHelper::operator =(cpad::insns::InsertionPointRequestHelper const&a_copy)
{
set_cunit_name(a_copy.cunit_name());
set_cfun_name(a_copy.cfun_name());
set_location(a_copy.location());
return *this;
}
size_t
cpad::insns::InsertionPointRequestHelper::serialize(char *buffer)
{
std::string local_buf;
SerializeToString(&local_buf);
local_buf.copy(buffer, local_buf.length());
return local_buf.length();
}
void
cpad::insns::InsertionPointRequestHelper::dump(std::ostream &osb)
{
osb << "[InsertionPointRequest]" << std::endl;
osb << "cunit name: " << cunit_name() << std::endl;
osb << "cfun name: " << cfun_name() << std::endl;
osb << "location: ";
switch (location())
{
case ::cpad::insns::FUNCTION_ENTRY_BLOCK:
osb << "::cpad::insns::FUNCTION_ENTRY_BLOCK";
break;
case ::cpad::insns::FUNCTION_BEFORE_CALL:
osb << "::cpad::insns::FUNCTION_BEFORE_CALL";
break;
case ::cpad::insns::FUNCTION_AFTER_CALL:
osb << "::cpad::insns::FUNCTION_AFTER_CALL";
break;
case ::cpad::insns::FUNCTION_EXIT_BLOCK:
osb << "::cpad::insns::FUNCTION_EXIT_BLOCK";
break;
case ::cpad::insns::BASIC_BLOCK_ENTRY:
osb << "::cpad::insns::BASIC_BLOCK_ENTRY";
break;
case ::cpad::insns::BASIC_BLOCK_EXIT:
osb << "::cpad::insns::BASIC_BLOCK_EXIT";
break;
default:
osb << "Unknown";
}
osb << " (" << location() << ")" << std::endl;
}
cpad::insns::InsertionPointResponseHelper::InsertionPointResponseHelper(bool insert_asm_statement,
std::string asm_statement)
: ::cpad::insns::InsertionPointResponse()
{
set_insert_asm_statement(insert_asm_statement);
set_asm_statement(asm_statement);
}
cpad::insns::InsertionPointResponseHelper::InsertionPointResponseHelper(const char *buffer)
: ::cpad::insns::InsertionPointResponse()
{
ParseFromString(std::string(buffer));
}
cpad::insns::InsertionPointResponseHelper::InsertionPointResponseHelper(const ::cpad::insns::InsertionPointResponse *response)
: ::cpad::insns::InsertionPointResponse(*response)
{
}
cpad::insns::InsertionPointResponseHelper::~InsertionPointResponseHelper()
{
}
cpad::insns::InsertionPointResponseHelper::InsertionPointResponseHelper(cpad::insns::InsertionPointResponseHelper const&a_copy)
: ::cpad::insns::InsertionPointResponseHelper(a_copy.insert_asm_statement(),
a_copy.asm_statement())
{
}
cpad::insns::InsertionPointResponseHelper&
cpad::insns::InsertionPointResponseHelper::operator =(cpad::insns::InsertionPointResponseHelper const&a_copy)
{
set_insert_asm_statement(a_copy.insert_asm_statement());
set_asm_statement(a_copy.asm_statement());
}
size_t
cpad::insns::InsertionPointResponseHelper::serialize(char *buffer)
{
std::string local_buf;
SerializeToString(&local_buf);
local_buf.copy(buffer, local_buf.length());
return local_buf.length();
}
void
cpad::insns::InsertionPointResponseHelper::dump(std::ostream &osb)
{
osb << "[InsertionPointResponse]" << std::endl;
osb << "insert asm statement: " << insert_asm_statement() << std::endl;
osb << "asm statement: " << asm_statement() << std::endl;
}