r300108 - [Modules] Enable local submodule visibility for ObjC/C
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 12 14:46:16 PDT 2017
Author: bruno
Date: Wed Apr 12 16:46:16 2017
New Revision: 300108
URL: http://llvm.org/viewvc/llvm-project?rev=300108&view=rev
Log:
[Modules] Enable local submodule visibility for ObjC/C
Remove the restriction where this is only valid with C++
rdar://problem/29055656
Differential Revision: https://reviews.llvm.org/D31781
Added:
cfe/trunk/test/Modules/localsubmodulevis.m
Modified:
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=300108&r1=300107&r2=300108&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Wed Apr 12 16:46:16 2017
@@ -2117,12 +2117,6 @@ static void ParseLangArgs(LangOptions &O
Args.hasFlag(OPT_fdeclspec, OPT_fno_declspec,
(Opts.MicrosoftExt || Opts.Borland || Opts.CUDA));
- // For now, we only support local submodule visibility in C++ (because we
- // heavily depend on the ODR for merging redefinitions).
- if (Opts.ModulesLocalVisibility && !Opts.CPlusPlus)
- Diags.Report(diag::err_drv_argument_not_allowed_with)
- << "-fmodules-local-submodule-visibility" << "C";
-
if (Arg *A = Args.getLastArg(OPT_faddress_space_map_mangling_EQ)) {
switch (llvm::StringSwitch<unsigned>(A->getValue())
.Case("target", LangOptions::ASMM_Target)
Added: cfe/trunk/test/Modules/localsubmodulevis.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/localsubmodulevis.m?rev=300108&view=auto
==============================================================================
--- cfe/trunk/test/Modules/localsubmodulevis.m (added)
+++ cfe/trunk/test/Modules/localsubmodulevis.m Wed Apr 12 16:46:16 2017
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -fimplicit-module-maps -fmodules-cache-path=%t.a -I %S/Inputs/preprocess -verify %s
+// RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -fimplicit-module-maps -fmodules-cache-path=%t.b -I %S/Inputs/preprocess -x c -verify -x c %s
+
+// expected-no-diagnostics
+
+#include "file.h"
+
More information about the cfe-commits
mailing list