Displaying 2 results from an estimated 2 matches for "__sancov_gen_".
2020 May 14
2
Sancov guard semantics for usage between comdats
...e_bar2() {
int x = inline_foo();
if (x % 37) {
x += 3;
}
return x;
}
};
int Foo::public_foo() {
return inline_foo() ? inline_bar1() : inline_bar2();
}
```
Compiling this with `clang++ -fsanitize-coverage=trace-pc-guard
/tmp/test.cpp -c -O1` generates sancov guards (__sancov_gen_.X) that are
used outside of their comdat group due to inlining:
```
@__sancov_gen_.1 = private global [3 x i32] zeroinitializer, section
"__sancov_guards", comdat($_ZN3Foo10inline_fooEv)
define dso_local i32 @_ZN3Foo10public_fooEv(%struct.Foo* %0)
local_unnamed_addr #0 comdat align 2 {...
2017 Jul 29
2
Storing "blockaddress(@function, %block)" in a global variable?
...y:
https://llvm.org/docs/LangRef.html#addresses-of-basic-blocks
But I wanted very much to save addresses of blocks in a global variable and
so I did:
% cat cond.c
void foo(long *a) { if (a) *a = 0; }
% clang -O1 -c cond.c -fsanitize-coverage=inline-8bit-counters,pc-table
-S -o - -emit-llvm
@__sancov_gen_.1 = private constant [3 x i8*] [i8* bitcast (void (i64*)*
@foo to i8*), i8* blockaddress(@foo, %entry.if.end_crit_edge), i8*
blockaddress(@foo, %if.then)], section "__sancov_pcs", align 8
Is this expected to work?
If not, is it reasonable to try to make it work?
This works almost as I w...