While working on applying an ancient patch (http://reviews.llvm.org/D498), I came across a lot of weirdness in the handling of fortified libcalls. First, they are checked by name rather than using the TLI enum (but one of them was there). Second, the code that simplifies the fortified libcalls into their non-checking counterparts (when the check is useless) is duplicated in both CGP and SimplifyLibCalls.
This series of patches tries to clean it up a bit.
[1/4] Add fortified (__*_chk) library functions to TLI. This shouldn't have any functional change. Note that the fortified libfuncs are now part of TLI, but are always available, because they aren't generated, only optimized into the non-checking versions.