[cfe-commits] r157395 - in /cfe/trunk/lib: ARCMigrate/ObjCMT.cpp Edit/RewriteObjCFoundationAPI.cpp
Jordy Rose
jediknil at belkadan.com
Thu May 24 10:05:11 PDT 2012
Test case? (Even if the diagnostic's going to change.)
On May 24, 2012, at 12:48, Argyrios Kyrtzidis wrote:
> Author: akirtzidis
> Date: Thu May 24 11:48:23 2012
> New Revision: 157395
>
> URL: http://llvm.org/viewvc/llvm-project?rev=157395&view=rev
> Log:
> [objcmt] Warn when modern objc migrator does not convert a NSNumber message because it requires a cast.
>
> rdar://11525138
>
> Modified:
> cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
> cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp
>
> Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=157395&r1=157394&r2=157395&view=diff
> ==============================================================================
> --- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
> +++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Thu May 24 11:48:23 2012
> @@ -209,6 +209,7 @@
> }
>
> bool MigrateSourceAction::BeginInvocation(CompilerInstance &CI) {
> + CI.getDiagnostics().setIgnoreAllWarnings(true);
> CI.getPreprocessorOpts().DetailedRecord = true;
> CI.getPreprocessorOpts().DetailedRecordConditionalDirectives = true;
> return true;
>
> Modified: cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp?rev=157395&r1=157394&r2=157395&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp (original)
> +++ cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp Thu May 24 11:48:23 2012
> @@ -801,8 +801,14 @@
> }
> }
>
> - if (needsCast)
> + if (needsCast) {
> + DiagnosticsEngine &Diags = Ctx.getDiagnostics();
> + // FIXME: Use a custom category name to distinguish migration diagnostics.
> + unsigned diagID = Diags.getCustomDiagID(DiagnosticsEngine::Warning,
> + "converting to boxing syntax requires a cast");
> + Diags.Report(Msg->getExprLoc(), diagID) << Msg->getSourceRange();
> return false;
> + }
>
> SourceRange ArgRange = OrigArg->getSourceRange();
> commit.replaceWithInner(Msg->getSourceRange(), ArgRange);
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list