summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/TransGCCalls.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-26 05:07:32 +0000
committerAlp Toker <alp@nuanti.com>2014-01-26 05:07:32 +0000
commit42aa21222d37406e22d48587ca4dc65ce9948b71 (patch)
tree414aaa19f71d2fb66da06cdfe102aed3a805ec02 /clang/lib/ARCMigrate/TransGCCalls.cpp
parent26521539047389de5733d8940197b5bd6f2457c3 (diff)
downloadbcm5719-llvm-42aa21222d37406e22d48587ca4dc65ce9948b71.tar.gz
bcm5719-llvm-42aa21222d37406e22d48587ca4dc65ce9948b71.zip
ARCMigrate: Introduce proper diagnostics for TransformActions
This starts to switch ARCMT to use proper diagnostic messages. The old use was based on incorrect example code from the documentation. The logic of the previous report() functions has been retained to support any external consumers that might be intercepting diagnostic messages through the old interface. Note that the change in test/Misc/warning-flags.c isn't a new warning without a flag, rather one that was previously invisible to the test. Adding a flag might be a good idea though. llvm-svn: 200124
Diffstat (limited to 'clang/lib/ARCMigrate/TransGCCalls.cpp')
-rw-r--r--clang/lib/ARCMigrate/TransGCCalls.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/clang/lib/ARCMigrate/TransGCCalls.cpp b/clang/lib/ARCMigrate/TransGCCalls.cpp
index 249f20f01b2..401e7880844 100644
--- a/clang/lib/ARCMigrate/TransGCCalls.cpp
+++ b/clang/lib/ARCMigrate/TransGCCalls.cpp
@@ -38,14 +38,8 @@ public:
TransformActions &TA = MigrateCtx.Pass.TA;
if (MigrateCtx.isGCOwnedNonObjC(E->getType())) {
- if (MigrateCtx.Pass.noNSAllocReallocError())
- TA.reportWarning("call returns pointer to GC managed memory; "
- "it will become unmanaged in ARC",
- E->getLocStart(), E->getSourceRange());
- else
- TA.reportError("call returns pointer to GC managed memory; "
- "it will become unmanaged in ARC",
- E->getLocStart(), E->getSourceRange());
+ TA.report(E->getLocStart(), diag::err_arcmt_nsalloc_realloc,
+ E->getSourceRange());
return true;
}
OpenPOWER on IntegriCloud