[PATCH] Refactor fortified (__*_chk) library function handling in TLI/LibCallSimplifier.

Ahmed Bougacha ahmed.bougacha at gmail.com
Fri Oct 24 11:49:22 PDT 2014


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.

http://reviews.llvm.org/D5982

Files:
  include/llvm/Target/TargetLibraryInfo.h
  lib/Target/TargetLibraryInfo.cpp
  lib/Transforms/Utils/SimplifyLibCalls.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5982.15425.patch
Type: text/x-patch
Size: 3393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141024/479120a9/attachment.bin>


More information about the llvm-commits mailing list