Implement more aggressive support for analyzing string length. This
authorChris Lattner <sabre@nondot.org>
Tue, 29 Apr 2008 06:56:02 +0000 (06:56 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 29 Apr 2008 06:56:02 +0000 (06:56 +0000)
commit5b222d748a0976497297fa77d1dd36328331e32c
tree4e53dc8bd0b58c3f67a5cd6850c394a17006c404
parent5f8b344255d1909d327df9a8322c2ad3733c328d
Implement more aggressive support for analyzing string length.  This
generalizes the previous code to handle the case when the string is not
an immediate to the strlen call (for example, crazy stuff like
strlen(c ? "foo" : "bart"+1) -> 3).  This implements
gcc.c-torture/execute/builtins/strlen-2.c.  I will generalize other
cases in simplifylibcalls to use the same routine later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50408 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/SimplifyLibCalls.cpp