[Lldb-commits] [PATCH] D40812: Remove no-op null checks, NFC

2017-12-06 Thread Phabricator via Phabricator via lldb-commits
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=125773#toc Repository: rL LLVM

[Lldb-commits] [PATCH] D40812: Remove no-op null checks, NFC

2017-12-04 Thread Vedant Kumar via Phabricator via lldb-commits
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.

[Lldb-commits] [PATCH] D40812: Remove no-op null checks, NFC

2017-12-04 Thread Jason Molenda via Phabricator via lldb-commits
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; }"

[Lldb-commits] [PATCH] D40812: Remove no-op null checks, NFC

2017-12-04 Thread Jason Molenda via Phabricator via lldb-commits
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

[Lldb-commits] [PATCH] D40812: Remove no-op null checks, NFC

2017-12-04 Thread Jason Molenda via Phabricator via lldb-commits
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

[Lldb-commits] [PATCH] D40812: Remove no-op null checks, NFC

2017-12-04 Thread Vedant Kumar via Phabricator via lldb-commits
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.