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
44f5e86f
Commit
44f5e86f
authored
9 years ago
by
Yonghong Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use better error reporting interface
Signed-off-by:
Yonghong Song
<
yhs@plumgrid.com
>
parent
894e3e05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
src/cc/b_frontend_action.cc
src/cc/b_frontend_action.cc
+6
-3
No files found.
src/cc/b_frontend_action.cc
View file @
44f5e86f
...
@@ -177,7 +177,8 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
...
@@ -177,7 +177,8 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
prefix
=
"bpf_tail_call_"
;
prefix
=
"bpf_tail_call_"
;
suffix
=
")"
;
suffix
=
")"
;
}
else
{
}
else
{
llvm
::
errs
()
<<
"error: unknown bpf_table operation "
<<
memb_name
<<
"
\n
"
;
C
.
getDiagnostics
().
Report
(
Call
->
getLocStart
(),
diag
::
err_expected
)
<<
"valid bpf_table operation"
;
return
false
;
return
false
;
}
}
prefix
+=
"((void *)bpf_pseudo_fd(1, "
+
fd
+
"), "
;
prefix
+=
"((void *)bpf_pseudo_fd(1, "
+
fd
+
"), "
;
...
@@ -387,13 +388,15 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
...
@@ -387,13 +388,15 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
map_type
=
BPF_MAP_TYPE_PROG_ARRAY
;
map_type
=
BPF_MAP_TYPE_PROG_ARRAY
;
}
}
if
(
map_type
==
BPF_MAP_TYPE_UNSPEC
)
{
if
(
map_type
==
BPF_MAP_TYPE_UNSPEC
)
{
llvm
::
errs
()
<<
"error: maps/prog is not supported
\n
"
;
C
.
getDiagnostics
().
Report
(
Decl
->
getLocStart
(),
diag
::
err_expected
)
<<
"kernel supporting maps/prog"
;
return
false
;
return
false
;
}
}
}
}
table
.
fd
=
bpf_create_map
(
map_type
,
table
.
key_size
,
table
.
leaf_size
,
table
.
max_entries
);
table
.
fd
=
bpf_create_map
(
map_type
,
table
.
key_size
,
table
.
leaf_size
,
table
.
max_entries
);
if
(
table
.
fd
<
0
)
{
if
(
table
.
fd
<
0
)
{
llvm
::
errs
()
<<
"error: could not open bpf fd
\n
"
;
C
.
getDiagnostics
().
Report
(
Decl
->
getLocStart
(),
diag
::
err_expected
)
<<
"valid bpf fd"
;
return
false
;
return
false
;
}
}
tables_
[
Decl
->
getName
()]
=
std
::
move
(
table
);
tables_
[
Decl
->
getName
()]
=
std
::
move
(
table
);
...
...
This diff is collapsed.
Click to expand it.
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