Make adding nocapture a bit stronger. FreeInst is nocapture. Also,
authorNick Lewycky <nicholas@mxc.ca>
Fri, 2 Jan 2009 03:46:56 +0000 (03:46 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Fri, 2 Jan 2009 03:46:56 +0000 (03:46 +0000)
commit6b0568628319e08b36b8ec14793083e6bbf101a7
tree4e600f6b3b7547f0ec7c9786d81dceef6612ed5b
parentb9b3a702c46f5f22364d07f26f20ad8b9fe97f34
Make adding nocapture a bit stronger. FreeInst is nocapture. Also,
functions that don't write can't leak a pointer except through
the return value, so a void readonly function is implicitly nocapture.

Test these, and add a test that verifies that f1 calling f2 with an
otherwise dead pointer gets both of them marked nocapture.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61552 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/FunctionAttrs.cpp
test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll