aboutsummaryrefslogtreecommitdiff
path: root/lib/ARCMigrate/TransGCCalls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ARCMigrate/TransGCCalls.cpp')
-rw-r--r--lib/ARCMigrate/TransGCCalls.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ARCMigrate/TransGCCalls.cpp b/lib/ARCMigrate/TransGCCalls.cpp
index 8042c6caba..94e965df18 100644
--- a/lib/ARCMigrate/TransGCCalls.cpp
+++ b/lib/ARCMigrate/TransGCCalls.cpp
@@ -35,6 +35,13 @@ public:
bool VisitCallExpr(CallExpr *E) {
TransformActions &TA = MigrateCtx.getPass().TA;
+ if (MigrateCtx.isGCOwnedNonObjC(E->getType())) {
+ TA.reportError("call returns pointer to GC managed memory; "
+ "it will become unmanaged in ARC",
+ E->getLocStart(), E->getSourceRange());
+ return true;
+ }
+
Expr *CEE = E->getCallee()->IgnoreParenImpCasts();
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(CEE)) {
if (FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(DRE->getDecl())) {