Skip to content
Snippets Groups Projects
Commit 5e8a35ff authored by Bruno Cardoso Lopes's avatar Bruno Cardoso Lopes
Browse files

[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300108 91177308-0d34-0410-b5e6-96231b3b80d8
parent 01692f0f
No related branches found
No related tags found
No related merge requests found
...@@ -2117,12 +2117,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, ...@@ -2117,12 +2117,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Args.hasFlag(OPT_fdeclspec, OPT_fno_declspec, Args.hasFlag(OPT_fdeclspec, OPT_fno_declspec,
(Opts.MicrosoftExt || Opts.Borland || Opts.CUDA)); (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)) { if (Arg *A = Args.getLastArg(OPT_faddress_space_map_mangling_EQ)) {
switch (llvm::StringSwitch<unsigned>(A->getValue()) switch (llvm::StringSwitch<unsigned>(A->getValue())
.Case("target", LangOptions::ASMM_Target) .Case("target", LangOptions::ASMM_Target)
......
// 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"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment