[PATCH] Prevent repetitive warnings for unrecognized processors and features (2nd attempt)

Artyom Skrobov Artyom.Skrobov at arm.com
Mon Feb 3 08:29:48 PST 2014


Hello,

Attached is the new patch, that includes an extensive refactoring of
MCSubtargetInfo and SubtargetFeatures, to prevent the repeated lookups of
CPU entries.
For the feature lookup failures, this still uses a set of strings to mark
the features whose lookup failed; but this set now belongs to the
MCSubtargetInfo instance.

OK to commit in this new form?


Later on, this will probably be accompanied with a front-end fix, as
suggested by Jim.


-----Original Message-----
From: Jim Grosbach [mailto:grosbach at apple.com] 
Sent: 30 January 2014 18:33
To: Artyom Skrobov
Cc: David Blaikie; llvm-commits at cs.uiuc.edu
Subject: Re: [llvm] r199886 - Prevent repetitive warnings for unrecognized
processors and features


On Jan 30, 2014, at 10:07 AM, Artyom Skrobov <Artyom.Skrobov at arm.com> wrote:

>> These are backend diagnostics only, right? I.e., they get issued by MC
>> when using developer tools like llvm-mc, llc, et. al.. They're
>> certainly not diagnostics we would ever expect to see from, e.g.,
>> clang or other user-level front-end. As such, I don't quite follow
>> why we should care about filtering duplicates at all. I don't oppose
>> uniquing them or anything, I just don't personally see it as a
>> priority. YMMV.
> 
> Yes, that's how it's supposed to be; but occasionally, these diagnostics
> "leak out" of the backend: one particular case that we're aware of, is
> 
> $ clang -target arm -mcpu=cortex-r4 -c test.c
> clang-3.5: warning: unknown platform, assuming -mfloat-abi=soft
> clang-3.5: warning: unknown platform, assuming -mfloat-abi=soft
> 'cortex-r4' is not a recognized processor for this target (ignoring
> processor)
> 'cortex-r4' is not a recognized processor for this target (ignoring
> processor)
> 'cortex-r4' is not a recognized processor for this target (ignoring
> processor)
> 'cortex-r4' is not a recognized processor for this target (ignoring
> processor)
> 'cortex-r4' is not a recognized processor for this target (ignoring
> processor)
> 'cortex-r4' is not a recognized processor for this target (ignoring
> processor)

Ew. That should be fixed in the front end to validate the argument to the
-mcpu option. I agree that's pretty bad as-is.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unrecognized-2.patch
Type: application/octet-stream
Size: 24432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140203/f0f78df8/attachment.obj>


More information about the llvm-commits mailing list