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
959e4036
Commit
959e4036
authored
Aug 18, 2016
by
Alexei Starovoitov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix build with 4.0 llvm trunk
Signed-off-by:
Alexei Starovoitov
<
ast@fb.com
>
parent
545008a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
src/cc/CMakeLists.txt
src/cc/CMakeLists.txt
+1
-1
src/cc/bpf_module.cc
src/cc/bpf_module.cc
+9
-1
No files found.
src/cc/CMakeLists.txt
View file @
959e4036
...
@@ -44,7 +44,7 @@ add_library(bcc-static STATIC bpf_common.cc bpf_module.cc shared_table.cc export
...
@@ -44,7 +44,7 @@ add_library(bcc-static STATIC bpf_common.cc bpf_module.cc shared_table.cc export
set_target_properties
(
bcc-static PROPERTIES OUTPUT_NAME bcc
)
set_target_properties
(
bcc-static PROPERTIES OUTPUT_NAME bcc
)
set
(
llvm_raw_libs bitwriter bpfcodegen irreader linker
set
(
llvm_raw_libs bitwriter bpfcodegen irreader linker
mcjit objcarcopts option passes nativecodegen
)
mcjit objcarcopts option passes nativecodegen
lto
)
list
(
FIND LLVM_AVAILABLE_LIBS
"LLVMCoverage"
_llvm_coverage
)
list
(
FIND LLVM_AVAILABLE_LIBS
"LLVMCoverage"
_llvm_coverage
)
if
(
${
_llvm_coverage
}
GREATER -1
)
if
(
${
_llvm_coverage
}
GREATER -1
)
list
(
APPEND llvm_raw_libs coverage
)
list
(
APPEND llvm_raw_libs coverage
)
...
...
src/cc/bpf_module.cc
View file @
959e4036
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <llvm/Support/TargetSelect.h>
#include <llvm/Support/TargetSelect.h>
#include <llvm/Transforms/IPO.h>
#include <llvm/Transforms/IPO.h>
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
#include <llvm-c/Transforms/IPO.h>
#include "exception.h"
#include "exception.h"
#include "frontends/b/loader.h"
#include "frontends/b/loader.h"
...
@@ -396,7 +397,14 @@ int BPFModule::run_pass_manager(Module &mod) {
...
@@ -396,7 +397,14 @@ int BPFModule::run_pass_manager(Module &mod) {
PassManagerBuilder
PMB
;
PassManagerBuilder
PMB
;
PMB
.
OptLevel
=
3
;
PMB
.
OptLevel
=
3
;
PM
.
add
(
createFunctionInliningPass
());
PM
.
add
(
createFunctionInliningPass
());
PM
.
add
(
createAlwaysInlinerPass
());
/*
* llvm < 4.0 needs
* PM.add(createAlwaysInlinerPass());
* llvm >= 4.0 needs
* PM.add(createAlwaysInlinerLegacyPass());
* use below 'stable' workaround
*/
LLVMAddAlwaysInlinerPass
(
reinterpret_cast
<
LLVMPassManagerRef
>
(
&
PM
));
PMB
.
populateModulePassManager
(
PM
);
PMB
.
populateModulePassManager
(
PM
);
if
(
flags_
&
1
)
if
(
flags_
&
1
)
PM
.
add
(
createPrintModulePass
(
outs
()));
PM
.
add
(
createPrintModulePass
(
outs
()));
...
...
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