[modules][Patch][BugzillaID#20467] Diagnose if -fmodules-cache-path is not writeable

Ben Langmuir blangmuir at apple.com
Wed Sep 17 12:46:13 PDT 2014


>  def err_no_submodule : Error<"no submodule named %0 in module '%1'">;
> Index: lib/Frontend/CompilerInstance.cpp
> ===================================================================
> --- lib/Frontend/CompilerInstance.cpp	(revision 217432)
> +++ lib/Frontend/CompilerInstance.cpp	(working copy)
> @@ -339,6 +339,15 @@
>    if (!getHeaderSearchOpts().DisableModuleHash)
>      llvm::sys::path::append(SpecificModuleCache,
>                              getInvocation().getModuleHash());
> +
> +  // If the path is not writable we can't do anything but diagnose.
> +  if (llvm::sys::fs::exists(SpecificModuleCache.str()) &&
> +       !llvm::sys::fs::can_write(SpecificModuleCache.str())) {


I think this check should only happen if we are building a module, or is there some reason we don’t want to allow read-only module caches when all the modules are prebuilt?

Ben

> On Sep 17, 2014, at 1:04 AM, Vassil Vassilev <vasil.georgiev.vasilev at cern.ch> wrote:
> 
> Hi,
>  I am attaching a patch addressing llvm.org/bugs/show_bug.cgi?id=20467
> Vassil
> 
> <Bug20467.diff>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list