OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__ | 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__ |
6 #define SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__ | 6 #define SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "sandbox/linux/sandbox_export.h" | |
13 #include "sandbox/linux/seccomp-bpf/basicblock.h" | 12 #include "sandbox/linux/seccomp-bpf/basicblock.h" |
14 #include "sandbox/linux/seccomp-bpf/instruction.h" | 13 #include "sandbox/linux/seccomp-bpf/instruction.h" |
15 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 14 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
| 15 #include "sandbox/sandbox_export.h" |
16 | 16 |
17 namespace sandbox { | 17 namespace sandbox { |
18 | 18 |
19 typedef std::vector<Instruction*> Instructions; | 19 typedef std::vector<Instruction*> Instructions; |
20 typedef std::vector<BasicBlock*> BasicBlocks; | 20 typedef std::vector<BasicBlock*> BasicBlocks; |
21 typedef std::map<const Instruction*, int> BranchTargets; | 21 typedef std::map<const Instruction*, int> BranchTargets; |
22 typedef std::map<const Instruction*, BasicBlock*> TargetsToBlocks; | 22 typedef std::map<const Instruction*, BasicBlock*> TargetsToBlocks; |
23 typedef std::map<const BasicBlock*, int> IncomingBranches; | 23 typedef std::map<const BasicBlock*, int> IncomingBranches; |
24 | 24 |
25 // The code generator instantiates a basic compiler that can convert a | 25 // The code generator instantiates a basic compiler that can convert a |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 BasicBlocks basic_blocks_; | 151 BasicBlocks basic_blocks_; |
152 | 152 |
153 // Compile() must only ever be called once as it makes destructive changes | 153 // Compile() must only ever be called once as it makes destructive changes |
154 // to the DAG. | 154 // to the DAG. |
155 bool compiled_; | 155 bool compiled_; |
156 }; | 156 }; |
157 | 157 |
158 } // namespace sandbox | 158 } // namespace sandbox |
159 | 159 |
160 #endif // SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__ | 160 #endif // SANDBOX_LINUX_SECCOMP_BPF_CODEGEN_H__ |
OLD | NEW |