[cfe-commits] r148887 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Frontend/CompilerInvocation.h include/clang/Frontend/MigratorOptions.h lib/ARCMigrate/ARCMT.cpp lib/ARCMigrate/Internals.h lib/ARCMigrate/TransGCCalls.cpp lib/ARCMigrate/TransformActions.cpp lib/Frontend/CompilerInvocation.cpp test/ARCMT/GC-check-warn-nsalloc.m

Aaron Ballman aaron at aaronballman.com
Mon May 19 16:07:57 PDT 2014


On Mon, May 19, 2014 at 6:59 PM, Alp Toker <alp at nuanti.com> wrote:
>
> On 19/05/2014 23:31, Richard Smith wrote:
>>
>> On Mon, May 19, 2014 at 1:11 PM, Jordan Rose <jordan_rose at apple.com
>> <mailto:jordan_rose at apple.com>> wrote:
>>
>>
>>
>>     > On May 19, 2014, at 12:30, Aaron Ballman <aaron at aaronballman.com
>>     <mailto:aaron at aaronballman.com>> wrote:
>>     >
>>     > I did a little bit more digging into the issue, and the problem
>>     is in
>>     > ARCMT.cpp:318, whic has the code:
>>     >
>>     >  Diags->setDiagnosticMapping(diag::err_arcmt_nsalloc_realloc,
>>     >                              NoNSAllocReallocError ?
>>     diag::MAP_WARNING
>>     >  : diag::MAP_ERROR,
>>     >                              SourceLocation());
>>     >
>>     > You cannot map an error diagnostic to be a warning.
>>     > DiagnosticsEngine::setDiagnosticMapping has this assert, which is
>>     > triggered by that code:
>>     >
>>     >  assert((Diags->isBuiltinWarningOrExtension(Diag) ||
>>     >          (Map == diag::MAP_FATAL || Map == diag::MAP_ERROR)) &&
>>     >         "Cannot map errors into warnings!");
>>     >
>>     > I'm not familiar enough with ARCMT to understand what is
>>     required for
>>     > the correct fix.
>>
>>     If the current behavior is correct, the right way to declare the
>>     diagnostic in the .td file is "Warning<...>, DefaultError".
>>
>>
>> ... and in that case, its name should not begin err_.
>
>
> Turns out the test was always disabled because multiple SourceManager
> instances were crashing VerifyDiagnosticConsumer.
>
> So I've added a TODO to look into that, grepified the test and provided
> useful behaviour for both -no-ns-alloc-error and -Wno-error=arcmt-ns-alloc
> to resolve the issue.
>
> r209172.

Thanks, Alp!

~Aaron



More information about the cfe-commits mailing list