Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
e7e04c0c
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e7e04c0c
编写于
2月 21, 2017
作者:
K
Kees Cook
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-next/gcc-plugin-infrastructure' into for-linus/gcc-plugins
上级
a121103c
5a45a4c5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
49 addition
and
28 deletion
+49
-28
scripts/gcc-plugins/cyc_complexity_plugin.c
scripts/gcc-plugins/cyc_complexity_plugin.c
+1
-5
scripts/gcc-plugins/gcc-common.h
scripts/gcc-plugins/gcc-common.h
+44
-11
scripts/gcc-plugins/latent_entropy_plugin.c
scripts/gcc-plugins/latent_entropy_plugin.c
+2
-6
scripts/gcc-plugins/sancov_plugin.c
scripts/gcc-plugins/sancov_plugin.c
+2
-6
未找到文件。
scripts/gcc-plugins/cyc_complexity_plugin.c
浏览文件 @
e7e04c0c
...
...
@@ -52,12 +52,8 @@ static unsigned int cyc_complexity_execute(void)
__visible
int
plugin_init
(
struct
plugin_name_args
*
plugin_info
,
struct
plugin_gcc_version
*
version
)
{
const
char
*
const
plugin_name
=
plugin_info
->
base_name
;
struct
register_pass_info
cyc_complexity_pass_info
;
cyc_complexity_pass_info
.
pass
=
make_cyc_complexity_pass
();
cyc_complexity_pass_info
.
reference_pass_name
=
"ssa"
;
cyc_complexity_pass_info
.
ref_pass_instance_number
=
1
;
cyc_complexity_pass_info
.
pos_op
=
PASS_POS_INSERT_AFTER
;
PASS_INFO
(
cyc_complexity
,
"ssa"
,
1
,
PASS_POS_INSERT_AFTER
);
if
(
!
plugin_default_version_check
(
version
,
&
gcc_version
))
{
error
(
G_
(
"incompatible gcc/plugin versions"
));
...
...
scripts/gcc-plugins/gcc-common.h
浏览文件 @
e7e04c0c
...
...
@@ -26,6 +26,9 @@
#include "except.h"
#include "function.h"
#include "toplev.h"
#if BUILDING_GCC_VERSION >= 5000
#include "expr.h"
#endif
#include "basic-block.h"
#include "intl.h"
#include "ggc.h"
...
...
@@ -80,6 +83,9 @@
#include "diagnostic.h"
#include "tree-dump.h"
#include "tree-pass.h"
#if BUILDING_GCC_VERSION >= 4009
#include "pass_manager.h"
#endif
#include "predict.h"
#include "ipa-utils.h"
...
...
@@ -119,20 +125,17 @@
#include "builtins.h"
#endif
/* #include "expr.h" where are you... */
extern
rtx
emit_move_insn
(
rtx
x
,
rtx
y
);
/* missing from basic_block.h... */
extern
void
debug_dominance_info
(
enum
cdi_direction
dir
);
extern
void
debug_dominance_tree
(
enum
cdi_direction
dir
,
basic_block
root
);
void
debug_dominance_info
(
enum
cdi_direction
dir
);
void
debug_dominance_tree
(
enum
cdi_direction
dir
,
basic_block
root
);
#if BUILDING_GCC_VERSION == 4006
extern
void
debug_gimple_stmt
(
gimple
);
extern
void
debug_gimple_seq
(
gimple_seq
);
extern
void
print_gimple_seq
(
FILE
*
,
gimple_seq
,
int
,
int
);
extern
void
print_gimple_stmt
(
FILE
*
,
gimple
,
int
,
int
);
extern
void
print_gimple_expr
(
FILE
*
,
gimple
,
int
,
int
);
extern
void
dump_gimple_stmt
(
pretty_printer
*
,
gimple
,
int
,
int
);
void
debug_gimple_stmt
(
gimple
);
void
debug_gimple_seq
(
gimple_seq
);
void
print_gimple_seq
(
FILE
*
,
gimple_seq
,
int
,
int
);
void
print_gimple_stmt
(
FILE
*
,
gimple
,
int
,
int
);
void
print_gimple_expr
(
FILE
*
,
gimple
,
int
,
int
);
void
dump_gimple_stmt
(
pretty_printer
*
,
gimple
,
int
,
int
);
#endif
#define __unused __attribute__((__unused__))
...
...
@@ -146,6 +149,29 @@ extern void dump_gimple_stmt(pretty_printer *, gimple, int, int);
/* should come from c-tree.h if only it were installed for gcc 4.5... */
#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1(TYPE)
static
inline
tree
build_const_char_string
(
int
len
,
const
char
*
str
)
{
tree
cstr
,
elem
,
index
,
type
;
cstr
=
build_string
(
len
,
str
);
elem
=
build_type_variant
(
char_type_node
,
1
,
0
);
index
=
build_index_type
(
size_int
(
len
-
1
));
type
=
build_array_type
(
elem
,
index
);
TREE_TYPE
(
cstr
)
=
type
;
TREE_CONSTANT
(
cstr
)
=
1
;
TREE_READONLY
(
cstr
)
=
1
;
TREE_STATIC
(
cstr
)
=
1
;
return
cstr
;
}
#define PASS_INFO(NAME, REF, ID, POS) \
struct register_pass_info NAME##_pass_info = { \
.pass = make_##NAME##_pass(), \
.reference_pass_name = REF, \
.ref_pass_instance_number = ID, \
.pos_op = POS, \
}
#if BUILDING_GCC_VERSION == 4005
#define FOR_EACH_LOCAL_DECL(FUN, I, D) \
for (tree vars = (FUN)->local_decls, (I) = 0; \
...
...
@@ -527,6 +553,8 @@ static inline const greturn *as_a_const_greturn(const_gimple stmt)
#define section_name_prefix LTO_SECTION_NAME_PREFIX
#define fatal_error(loc, gmsgid, ...) fatal_error((gmsgid), __VA_ARGS__)
rtx
emit_move_insn
(
rtx
x
,
rtx
y
);
typedef
struct
rtx_def
rtx_insn
;
static
inline
const
char
*
get_decl_section_name
(
const_tree
decl
)
...
...
@@ -643,6 +671,11 @@ static inline const greturn *as_a_const_greturn(const_gimple stmt)
#define NODE_DECL(node) (node)->decl
#define cgraph_node_name(node) (node)->name()
#define NODE_IMPLICIT_ALIAS(node) (node)->cpp_implicit_alias
static
inline
opt_pass
*
get_pass_for_id
(
int
id
)
{
return
g
->
get_passes
()
->
get_pass_for_id
(
id
);
}
#endif
#if BUILDING_GCC_VERSION >= 5000 && BUILDING_GCC_VERSION < 6000
...
...
scripts/gcc-plugins/latent_entropy_plugin.c
浏览文件 @
e7e04c0c
...
...
@@ -592,12 +592,6 @@ __visible int plugin_init(struct plugin_name_args *plugin_info,
const
struct
plugin_argument
*
const
argv
=
plugin_info
->
argv
;
int
i
;
struct
register_pass_info
latent_entropy_pass_info
;
latent_entropy_pass_info
.
pass
=
make_latent_entropy_pass
();
latent_entropy_pass_info
.
reference_pass_name
=
"optimized"
;
latent_entropy_pass_info
.
ref_pass_instance_number
=
1
;
latent_entropy_pass_info
.
pos_op
=
PASS_POS_INSERT_BEFORE
;
static
const
struct
ggc_root_tab
gt_ggc_r_gt_latent_entropy
[]
=
{
{
.
base
=
&
latent_entropy_decl
,
...
...
@@ -609,6 +603,8 @@ __visible int plugin_init(struct plugin_name_args *plugin_info,
LAST_GGC_ROOT_TAB
};
PASS_INFO
(
latent_entropy
,
"optimized"
,
1
,
PASS_POS_INSERT_BEFORE
);
if
(
!
plugin_default_version_check
(
version
,
&
gcc_version
))
{
error
(
G_
(
"incompatible gcc/plugin versions"
));
return
1
;
...
...
scripts/gcc-plugins/sancov_plugin.c
浏览文件 @
e7e04c0c
...
...
@@ -89,7 +89,6 @@ static void sancov_start_unit(void __unused *gcc_data, void __unused *user_data)
__visible
int
plugin_init
(
struct
plugin_name_args
*
plugin_info
,
struct
plugin_gcc_version
*
version
)
{
int
i
;
struct
register_pass_info
sancov_plugin_pass_info
;
const
char
*
const
plugin_name
=
plugin_info
->
base_name
;
const
int
argc
=
plugin_info
->
argc
;
const
struct
plugin_argument
*
const
argv
=
plugin_info
->
argv
;
...
...
@@ -107,14 +106,11 @@ __visible int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gc
};
/* BBs can be split afterwards?? */
sancov_plugin_pass_info
.
pass
=
make_sancov_pass
();
#if BUILDING_GCC_VERSION >= 4009
sancov_plugin_pass_info
.
reference_pass_name
=
"asan"
;
PASS_INFO
(
sancov
,
"asan"
,
0
,
PASS_POS_INSERT_BEFORE
)
;
#else
sancov_plugin_pass_info
.
reference_pass_name
=
"nrv"
;
PASS_INFO
(
sancov
,
"nrv"
,
1
,
PASS_POS_INSERT_BEFORE
)
;
#endif
sancov_plugin_pass_info
.
ref_pass_instance_number
=
0
;
sancov_plugin_pass_info
.
pos_op
=
PASS_POS_INSERT_BEFORE
;
if
(
!
plugin_default_version_check
(
version
,
&
gcc_version
))
{
error
(
G_
(
"incompatible gcc/plugin versions"
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录