[PATCH] D23871: [Modules] Add 'freestanding' to the 'requires-declaration' feature-list.

Elad Cohen via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 3 23:09:17 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL280613: [Modules] Add 'freestanding' to the 'requires-declaration' feature-list. (authored by eladcohen).

Changed prior to commit:
  https://reviews.llvm.org/D23871?vs=69239&id=70279#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23871

Files:
  cfe/trunk/docs/Modules.rst
  cfe/trunk/lib/Basic/Module.cpp
  cfe/trunk/lib/Headers/module.modulemap
  cfe/trunk/test/Modules/compiler_builtins_x86.c

Index: cfe/trunk/docs/Modules.rst
===================================================================
--- cfe/trunk/docs/Modules.rst
+++ cfe/trunk/docs/Modules.rst
@@ -413,6 +413,9 @@
 cplusplus11
   C++11 support is available.
 
+freestanding
+  A freestanding environment is available.
+
 gnuinlineasm
   GNU inline ASM is available.
 
Index: cfe/trunk/test/Modules/compiler_builtins_x86.c
===================================================================
--- cfe/trunk/test/Modules/compiler_builtins_x86.c
+++ cfe/trunk/test/Modules/compiler_builtins_x86.c
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -verify -ffreestanding
+// expected-no-diagnostics
+
+#include<x86intrin.h>
+
Index: cfe/trunk/lib/Basic/Module.cpp
===================================================================
--- cfe/trunk/lib/Basic/Module.cpp
+++ cfe/trunk/lib/Basic/Module.cpp
@@ -64,6 +64,7 @@
                         .Case("blocks", LangOpts.Blocks)
                         .Case("cplusplus", LangOpts.CPlusPlus)
                         .Case("cplusplus11", LangOpts.CPlusPlus11)
+                        .Case("freestanding", LangOpts.Freestanding)
                         .Case("gnuinlineasm", LangOpts.GNUAsm)
                         .Case("objc", LangOpts.ObjC1)
                         .Case("objc_arc", LangOpts.ObjCAutoRefCount)
Index: cfe/trunk/lib/Headers/module.modulemap
===================================================================
--- cfe/trunk/lib/Headers/module.modulemap
+++ cfe/trunk/lib/Headers/module.modulemap
@@ -63,6 +63,7 @@
     textual header "mwaitxintrin.h"
 
     explicit module mm_malloc {
+      requires !freestanding
       header "mm_malloc.h"
       export * // note: for <stdlib.h> dependency
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23871.70279.patch
Type: text/x-patch
Size: 1818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160904/aff0cb93/attachment-0001.bin>


More information about the cfe-commits mailing list