diff options
author | Dan Gohman <gohman@apple.com> | 2011-12-14 19:10:53 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2011-12-14 19:10:53 +0000 |
commit | f9096e450bb6047ab330c94749f5e80178a62b09 (patch) | |
tree | bb9cf8beb14f9c78a50b7c9180f4ae39a75c9630 /lib/Transforms | |
parent | 5e46dcbb4b6f6e82f7bb88490800ed09ac02f105 (diff) | |
download | external_llvm-f9096e450bb6047ab330c94749f5e80178a62b09.zip external_llvm-f9096e450bb6047ab330c94749f5e80178a62b09.tar.gz external_llvm-f9096e450bb6047ab330c94749f5e80178a62b09.tar.bz2 |
It turns out that clang does use pointer-to-function types to
point to ARC-managed pointers sometimes. This fixes rdar://10551239.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/ObjCARC.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/ObjCARC.cpp b/lib/Transforms/Scalar/ObjCARC.cpp index ab23884..8e9449f 100644 --- a/lib/Transforms/Scalar/ObjCARC.cpp +++ b/lib/Transforms/Scalar/ObjCARC.cpp @@ -179,9 +179,13 @@ static bool IsPotentialUse(const Value *Op) { Arg->hasNestAttr() || Arg->hasStructRetAttr()) return false; - // Only consider values with pointer types, and not function pointers. + // Only consider values with pointer types. + // It seemes intuitive to exclude function pointer types as well, since + // functions are never reference-counted, however clang occasionally + // bitcasts reference-counted pointers to function-pointer type + // temporarily. PointerType *Ty = dyn_cast<PointerType>(Op->getType()); - if (!Ty || isa<FunctionType>(Ty->getElementType())) + if (!Ty) return false; // Conservatively assume anything else is a potential use. return true; |