}
bool MigrateSourceAction::BeginInvocation(CompilerInstance &CI) {
+ CI.getDiagnostics().setIgnoreAllWarnings(true);
CI.getPreprocessorOpts().DetailedRecord = true;
CI.getPreprocessorOpts().DetailedRecordConditionalDirectives = true;
return true;
}
}
- 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);