[PATCH] D31781: [Modules] Allow local submodule visibility without c++

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 12 14:59:07 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL300108: [Modules] Enable local submodule visibility for ObjC/C (authored by bruno).

Changed prior to commit:
  https://reviews.llvm.org/D31781?vs=94407&id=95034#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D31781

Files:
  cfe/trunk/lib/Frontend/CompilerInvocation.cpp
  cfe/trunk/test/Modules/localsubmodulevis.m


Index: cfe/trunk/test/Modules/localsubmodulevis.m
===================================================================
--- cfe/trunk/test/Modules/localsubmodulevis.m
+++ cfe/trunk/test/Modules/localsubmodulevis.m
@@ -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"
+
Index: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp
@@ -2117,12 +2117,6 @@
       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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31781.95034.patch
Type: text/x-patch
Size: 1471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170412/53576434/attachment.bin>


More information about the cfe-commits mailing list