This revision was automatically updated to reflect the committed changes.
Closed by commit rL319936: Remove no-op function pointer null checks, NFC
(authored by vedantk).
Changed prior to commit:
https://reviews.llvm.org/D40812?vs=125437&id=125773#toc
Repository:
rL LLVM
https://reviews.llv
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.
Ah I see, I bet I assumed it was marked weak but it never was. patch looks
good to me.
https://reviews.llvm.org/D40812
___
lldb-com
vsk added a comment.
Ah, sorry, I should have mentioned that the header vending
compression_decode_buffer() does not provide the 'weak_import' attribute (as
far as I can see!). If you change your example to drop 'weak_import' from foo,
I think it will be closer to the current situation.
https
jasonmolenda added a comment.
The output looks like this:
% make
echo 'int foo() { return 5; }' > mylib.c
echo "int foo() __attribute__((weak_import)); int printf(const char *, ...);
int main() { if (foo) printf (\"have foo() %d\\\n\", foo()); else printf(\"do
not have foo\\\n\"); return 0; }"
jasonmolenda added a comment.
all:
echo 'int foo() { return 5; }' > mylib.c
echo "int foo() __attribute__((weak_import)); int printf(const char *,
...); int main() { if (foo) printf (\"have foo() %d\\\n\", foo()); else
printf(\"do not have foo\\\n\"); return 0; }" > main.c
jasonmolenda added a comment.
I don't think that is correct. here's an example in the form of a makefile.
the main binary calls foo() which is weak linked from a library. In the first
run, foo() is present in the library. In the second run, the library is
rebuilt so foo() is absent. The be
vsk created this revision.
Null-checking functions which aren't marked 'weak_import' is a no-op
(the compiler rewrites the check to 'true'), regardless of whether a
library providing its definition is weak-linked.
Remove the no-op checks to clean up the code and silence
-Wpointer-to-bool.
https