r229834 - Make -fmodules-decluse and -fmodules-strict-decluse compatible options.
Daniel Jasper
djasper at google.com
Thu Feb 19 01:56:14 PST 2015
Author: djasper
Date: Thu Feb 19 03:56:13 2015
New Revision: 229834
URL: http://llvm.org/viewvc/llvm-project?rev=229834&view=rev
Log:
Make -fmodules-decluse and -fmodules-strict-decluse compatible options.
They don't actually influence the result of the module compilation.
Added:
cfe/trunk/test/Modules/declare-use-compatible.cpp
Modified:
cfe/trunk/include/clang/Basic/LangOptions.def
Modified: cfe/trunk/include/clang/Basic/LangOptions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=229834&r1=229833&r2=229834&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/LangOptions.def (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.def Thu Feb 19 03:56:13 2015
@@ -123,9 +123,9 @@ BENIGN_LANGOPT(EmitAllDecls , 1, 0,
LANGOPT(MathErrno , 1, 1, "errno support for math functions")
BENIGN_LANGOPT(HeinousExtensions , 1, 0, "Extensions that we really don't like and may be ripped out at any time")
LANGOPT(Modules , 1, 0, "modules extension to C")
-LANGOPT(ModulesDeclUse , 1, 0, "require declaration of module uses")
+COMPATIBLE_LANGOPT(ModulesDeclUse , 1, 0, "require declaration of module uses")
LANGOPT(ModulesSearchAll , 1, 1, "search even non-imported modules to find unresolved references")
-LANGOPT(ModulesStrictDeclUse, 1, 0, "require declaration of module uses and all headers to be in modules")
+COMPATIBLE_LANGOPT(ModulesStrictDeclUse, 1, 0, "require declaration of module uses and all headers to be in modules")
LANGOPT(ModulesErrorRecovery, 1, 1, "automatically import modules as needed when performing error recovery")
BENIGN_LANGOPT(ModulesImplicitMaps, 1, 1, "use files called module.modulemap implicitly as module maps")
COMPATIBLE_LANGOPT(Optimize , 1, 0, "__OPTIMIZE__ predefined macro")
Added: cfe/trunk/test/Modules/declare-use-compatible.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/declare-use-compatible.cpp?rev=229834&view=auto
==============================================================================
--- cfe/trunk/test/Modules/declare-use-compatible.cpp (added)
+++ cfe/trunk/test/Modules/declare-use-compatible.cpp Thu Feb 19 03:56:13 2015
@@ -0,0 +1,36 @@
+// Used module not built with -decluse.
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x c++ -fmodules -fmodule-name=XB -emit-module \
+// RUN: -I %S/Inputs/declare-use %S/Inputs/declare-use/module.map -o %t/b.pcm
+// RUN: %clang_cc1 -x c++ -fmodules -fmodules-cache-path=%t \
+// RUN: -fmodules-decluse \
+// RUN: -fmodule-file=%t/b.pcm -fmodule-name=XE -I %S/Inputs/declare-use %s
+//
+// Main module not built with -decluse.
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x c++ -fmodules -fmodule-name=XB -emit-module \
+// RUN: -fmodules-decluse \
+// RUN: -I %S/Inputs/declare-use %S/Inputs/declare-use/module.map -o %t/b.pcm
+// RUN: %clang_cc1 -x c++ -fmodules -fmodules-cache-path=%t \
+// RUN: -fmodule-file=%t/b.pcm -fmodule-name=XE -I %S/Inputs/declare-use %s
+//
+// Used module not built with -decluse.
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x c++ -fmodules -fmodule-name=XB -emit-module \
+// RUN: -I %S/Inputs/declare-use %S/Inputs/declare-use/module.map -o %t/b.pcm
+// RUN: %clang_cc1 -x c++ -fmodules -fmodules-cache-path=%t \
+// RUN: -fmodules-strict-decluse \
+// RUN: -fmodule-file=%t/b.pcm -fmodule-name=XE -I %S/Inputs/declare-use %s
+//
+// Main module not built with -decluse.
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x c++ -fmodules -fmodule-name=XB -emit-module \
+// RUN: -fmodules-strict-decluse \
+// RUN: -I %S/Inputs/declare-use %S/Inputs/declare-use/module.map -o %t/b.pcm
+// RUN: %clang_cc1 -x c++ -fmodules -fmodules-cache-path=%t \
+// RUN: -fmodule-file=%t/b.pcm -fmodule-name=XE -I %S/Inputs/declare-use %s
+
+#include "b.h"
+
+const int g = b;
+
More information about the cfe-commits
mailing list