<div dir="ltr">Hi Elad,<div><br></div><div>This commit broke all buildbots that don't default to targetting x86. I've committed a fix with r280658, but could you please double check it's correct.</div><div><br></div><div>Cheers,</div><div><br></div><div>James</div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, 4 Sep 2016 at 07:09 Elad Cohen via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: eladcohen<br>
Date: Sun Sep  4 01:00:42 2016<br>
New Revision: 280613<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=280613&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=280613&view=rev</a><br>
Log:<br>
[Modules] Add 'freestanding' to the 'requires-declaration' feature-list.<br>
<br>
This adds support for modules that require (non-)freestanding<br>
environment, such as the compiler builtin mm_malloc submodule.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D23871" rel="noreferrer" target="_blank">https://reviews.llvm.org/D23871</a><br>
<br>
<br>
Added:<br>
    cfe/trunk/test/Modules/compiler_builtins_x86.c<br>
Modified:<br>
    cfe/trunk/docs/Modules.rst<br>
    cfe/trunk/lib/Basic/Module.cpp<br>
    cfe/trunk/lib/Headers/module.modulemap<br>
<br>
Modified: cfe/trunk/docs/Modules.rst<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/Modules.rst?rev=280613&r1=280612&r2=280613&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/Modules.rst?rev=280613&r1=280612&r2=280613&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/docs/Modules.rst (original)<br>
+++ cfe/trunk/docs/Modules.rst Sun Sep  4 01:00:42 2016<br>
@@ -413,6 +413,9 @@ cplusplus<br>
 cplusplus11<br>
   C++11 support is available.<br>
<br>
+freestanding<br>
+  A freestanding environment is available.<br>
+<br>
 gnuinlineasm<br>
   GNU inline ASM is available.<br>
<br>
<br>
Modified: cfe/trunk/lib/Basic/Module.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Module.cpp?rev=280613&r1=280612&r2=280613&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Module.cpp?rev=280613&r1=280612&r2=280613&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Basic/Module.cpp (original)<br>
+++ cfe/trunk/lib/Basic/Module.cpp Sun Sep  4 01:00:42 2016<br>
@@ -64,6 +64,7 @@ static bool hasFeature(StringRef Feature<br>
                         .Case("blocks", LangOpts.Blocks)<br>
                         .Case("cplusplus", LangOpts.CPlusPlus)<br>
                         .Case("cplusplus11", LangOpts.CPlusPlus11)<br>
+                        .Case("freestanding", LangOpts.Freestanding)<br>
                         .Case("gnuinlineasm", LangOpts.GNUAsm)<br>
                         .Case("objc", LangOpts.ObjC1)<br>
                         .Case("objc_arc", LangOpts.ObjCAutoRefCount)<br>
<br>
Modified: cfe/trunk/lib/Headers/module.modulemap<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/module.modulemap?rev=280613&r1=280612&r2=280613&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/module.modulemap?rev=280613&r1=280612&r2=280613&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Headers/module.modulemap (original)<br>
+++ cfe/trunk/lib/Headers/module.modulemap Sun Sep  4 01:00:42 2016<br>
@@ -63,6 +63,7 @@ module _Builtin_intrinsics [system] [ext<br>
     textual header "mwaitxintrin.h"<br>
<br>
     explicit module mm_malloc {<br>
+      requires !freestanding<br>
       header "mm_malloc.h"<br>
       export * // note: for <stdlib.h> dependency<br>
     }<br>
<br>
Added: cfe/trunk/test/Modules/compiler_builtins_x86.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/compiler_builtins_x86.c?rev=280613&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/compiler_builtins_x86.c?rev=280613&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Modules/compiler_builtins_x86.c (added)<br>
+++ cfe/trunk/test/Modules/compiler_builtins_x86.c Sun Sep  4 01:00:42 2016<br>
@@ -0,0 +1,6 @@<br>
+// RUN: rm -rf %t<br>
+// RUN: %clang_cc1 -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -verify -ffreestanding<br>
+// expected-no-diagnostics<br>
+<br>
+#include<x86intrin.h><br>
+<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>