Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
259ff4e2
Commit
259ff4e2
authored
Nov 29, 2016
by
Teng Qin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use StatusTuple constructor in mkstatus_
parent
13ebe8e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
src/cc/bcc_exception.h
src/cc/bcc_exception.h
+4
-0
src/cc/frontends/b/node.h
src/cc/frontends/b/node.h
+6
-8
No files found.
src/cc/bcc_exception.h
View file @
259ff4e2
...
...
@@ -37,6 +37,10 @@ public:
msg_
=
std
::
string
(
buf
);
}
void
append_msg
(
const
std
::
string
&
msg
)
{
msg_
+=
msg
;
}
int
code
()
{
return
ret_
;
}
std
::
string
msg
()
{
return
msg_
;
}
...
...
src/cc/frontends/b/node.h
View file @
259ff4e2
...
...
@@ -115,19 +115,17 @@ class Node {
template
<
typename
...
Args
>
StatusTuple
mkstatus_
(
Node
*
n
,
const
char
*
fmt
,
Args
...
args
)
{
char
buf
[
2048
];
snprintf
(
buf
,
sizeof
(
buf
),
fmt
,
args
...);
string
out_msg
(
buf
);
StatusTuple
status
=
StatusTuple
(
n
->
line_
?
n
->
line_
:
-
1
,
fmt
,
args
...);
if
(
n
->
line_
>
0
)
out_msg
+=
"
\n
"
+
n
->
text_
;
return
StatusTuple
(
n
->
line_
?
n
->
line_
:
-
1
,
out_msg
)
;
status
.
append_msg
(
"
\n
"
+
n
->
text_
)
;
return
status
;
}
static
inline
StatusTuple
mkstatus_
(
Node
*
n
,
const
char
*
msg
)
{
string
out_msg
(
msg
);
StatusTuple
status
=
StatusTuple
(
n
->
line_
?
n
->
line_
:
-
1
,
msg
);
if
(
n
->
line_
>
0
)
out_msg
+=
"
\n
"
+
n
->
text_
;
return
StatusTuple
(
n
->
line_
?
n
->
line_
:
-
1
,
out_msg
)
;
status
.
append_msg
(
"
\n
"
+
n
->
text_
)
;
return
status
;
}
class
StmtNode
:
public
Node
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment