[cfe-commits] r149227 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Basic/Module.cpp lib/Basic/Targets.cpp lib/Headers/module.map test/Modules/compiler_builtins.m

Douglas Gregor dgregor at apple.com
Mon Jan 30 11:00:02 PST 2012


On Jan 30, 2012, at 1:02 AM, Sebastian Redl wrote:

> On 30.01.2012 07:38, Douglas Gregor wrote:
>> Author: dgregor
>> Date: Mon Jan 30 00:38:25 2012
>> New Revision: 149227
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=149227&view=rev
>> Log:
>> Introduce TargetInfo::hasFeature() to query various feature names in
>> each of the targets. Use this for module requirements, so that we can
>> pin the availability of certain modules to certain target features,
>> e.g., provide a module for xmmintrin.h only when SSE support is
>> available.
>> 
>> Use these feature names to provide a nearly-complete module map for
>> Clang's built-in headers. Only mm_alloc.h and unwind.h are missing,
>> and those two are fairly specialized at the moment. Finishes
>> <rdar://problem/10710060>.
>> 
>> +    explicit module avx {
>> +      requires avx
>> +      export sse4_2
>> +      header "avxintrin.h"
>> +    }
>> +
>> +    explicit module avx2 {
>> +      requires avx2
>> +      export acx
>> +      header "avx2intrin.h"
>> +    }
>> 
> s/acx/avx/

r149257, thanks!

> Also, could you use this for resolving the tgmath info? A c99stdlib 
> feature or something like that?


Yes, we could. The trickiest part here is determining that the target environment has a C99 library.

	- Doug



More information about the cfe-commits mailing list