Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bpftrace
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
bpftrace
Commits
5eaa5783
Commit
5eaa5783
authored
Oct 17, 2018
by
Tommi Rantala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass strings by const reference
parent
8ec651e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
src/ast/codegen_llvm.cpp
src/ast/codegen_llvm.cpp
+2
-2
src/ast/codegen_llvm.h
src/ast/codegen_llvm.h
+2
-2
src/clang_parser.cpp
src/clang_parser.cpp
+1
-1
No files found.
src/ast/codegen_llvm.cpp
View file @
5eaa5783
...
...
@@ -1141,7 +1141,7 @@ void CodegenLLVM::visit(Program &program)
probe
->
accept
(
*
this
);
}
int
CodegenLLVM
::
getNextIndexForProbe
(
std
::
string
probe_name
)
{
int
CodegenLLVM
::
getNextIndexForProbe
(
const
std
::
string
&
probe_name
)
{
if
(
next_probe_index_
.
count
(
probe_name
)
==
0
)
next_probe_index_
[
probe_name
]
=
1
;
int
index
=
next_probe_index_
[
probe_name
];
...
...
@@ -1149,7 +1149,7 @@ int CodegenLLVM::getNextIndexForProbe(std::string probe_name) {
return
index
;
}
std
::
string
CodegenLLVM
::
getSectionNameForProbe
(
std
::
string
probe_name
,
int
index
)
{
std
::
string
CodegenLLVM
::
getSectionNameForProbe
(
const
std
::
string
&
probe_name
,
int
index
)
{
return
"s_"
+
probe_name
+
"_"
+
std
::
to_string
(
index
);
}
...
...
src/ast/codegen_llvm.h
View file @
5eaa5783
...
...
@@ -49,8 +49,8 @@ public:
void
visit
(
Program
&
program
)
override
;
AllocaInst
*
getMapKey
(
Map
&
map
);
AllocaInst
*
getHistMapKey
(
Map
&
map
,
Value
*
log2
);
int
getNextIndexForProbe
(
std
::
string
probe_name
);
std
::
string
getSectionNameForProbe
(
std
::
string
probe_name
,
int
index
);
int
getNextIndexForProbe
(
const
std
::
string
&
probe_name
);
std
::
string
getSectionNameForProbe
(
const
std
::
string
&
probe_name
,
int
index
);
Value
*
createLogicalAnd
(
Binop
&
binop
);
Value
*
createLogicalOr
(
Binop
&
binop
);
...
...
src/clang_parser.cpp
View file @
5eaa5783
...
...
@@ -106,7 +106,7 @@ static bool is_dir(const std::string& path)
return
S_ISDIR
(
buf
.
st_mode
);
}
static
std
::
pair
<
bool
,
std
::
string
>
get_kernel_path_info
(
const
std
::
string
kdir
)
static
std
::
pair
<
bool
,
std
::
string
>
get_kernel_path_info
(
const
std
::
string
&
kdir
)
{
if
(
is_dir
(
kdir
+
"/build"
)
&&
is_dir
(
kdir
+
"/source"
))
return
std
::
make_pair
(
true
,
"source"
);
...
...
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