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 | bd944b41533f161ded3ed98b0949aaf8110bebe2 (patch) | |
tree | 71b47b8202bfb4a9192077e74acdd64334f828f1 /llvm/lib/Transforms | |
parent | 96b4874b5097136a48c7fe5ff2b62534ef837e5f (diff) | |
download | bcm5719-llvm-bd944b41533f161ded3ed98b0949aaf8110bebe2.tar.gz bcm5719-llvm-bd944b41533f161ded3ed98b0949aaf8110bebe2.zip |
It turns out that clang does use pointer-to-function types to
point to ARC-managed pointers sometimes. This fixes rdar://10551239.
llvm-svn: 146577
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/ObjCARC.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/ObjCARC.cpp b/llvm/lib/Transforms/Scalar/ObjCARC.cpp index ab23884bb04..8e9449f5188 100644 --- a/llvm/lib/Transforms/Scalar/ObjCARC.cpp +++ b/llvm/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; |