summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-08-28 17:07:04 +0000
committerJordan Rose <jordan_rose@apple.com>2013-08-28 17:07:04 +0000
commit3aa6f431897edf5fec32cbede8fcddbfb8fa16f7 (patch)
treeae2749ffab803aaec5bc94f043f174c255c5a328 /lib/CodeGen/CodeGenFunction.cpp
parentf54617858a0df936746b7f521a8ffb032289d02f (diff)
downloadclang-3aa6f431897edf5fec32cbede8fcddbfb8fa16f7.tar.gz
clang-3aa6f431897edf5fec32cbede8fcddbfb8fa16f7.tar.bz2
clang-3aa6f431897edf5fec32cbede8fcddbfb8fa16f7.tar.xz
[analyzer] Add support for testing the presence of weak functions.
When casting the address of a FunctionTextRegion to bool, or when adding constraints to such an address, use a stand-in symbol to represent the presence or absence of the function if the function is weakly linked. This is groundwork for possible simple availability testing checks, and can already catch mistakes involving inverted null checks for weakly-linked functions. Currently, the implementation reuses the "extent" symbols, originally created for tracking the size of a malloc region. Since FunctionTextRegions cannot be dereferenced, the extent symbol will never be used for anything else. Still, this probably deserves a refactoring in the future. This patch does not attempt to support testing the presence of weak /variables/ (global variables), which would likely require much more of a change and a generalization of "region structure metadata", like the current "extents", vs. "region contents metadata", like CStringChecker's "string length". Patch by Richard <tarka.t.otter@googlemail.com>! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189492 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions