supplied, use something derived from the system's temporary
directory. Depends on LLVM r139725.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139726
91177308-0d34-0410-b5e6-
96231b3b80d8
HelpText<"Disable standard #include directories for the C++ standard library">;
def nobuiltininc : Flag<"-nobuiltininc">,
HelpText<"Disable builtin #include directories">;
-def fmodule_cache_path : JoinedOrSeparate<"-fmodule-cache-path">,
+def fmodule_cache_path : Separate<"-fmodule-cache-path">,
MetaVarName<"<directory>">,
HelpText<"Specify the module cache path">;
def fdisable_module_hash : Flag<"-fdisable-module-hash">,
def fms_extensions : Flag<"-fms-extensions">, Group<f_Group>;
def fmsc_version : Joined<"-fmsc-version=">, Group<f_Group>;
def fdelayed_template_parsing : Flag<"-fdelayed-template-parsing">, Group<f_Group>;
+def fmodule_cache_path : Separate<"-fmodule-cache-path">, Group<i_Group>,
+ Flags<[NoForward]>;
def fmudflapth : Flag<"-fmudflapth">, Group<f_Group>;
def fmudflap : Flag<"-fmudflap">, Group<f_Group>;
def fnested_functions : Flag<"-fnested-functions">, Group<f_Group>;
CmdArgs.push_back(A->getValue(Args));
}
}
+
+ // If a module path was provided, pass it along. Otherwise, use a temporary
+ // directory.
+ if (Arg *A = Args.getLastArg(options::OPT_fmodule_cache_path)) {
+ CmdArgs.push_back(A->getValue(Args));
+ A->claim();
+ A->render(Args, CmdArgs);
+ } else {
+ llvm::SmallString<128> DefaultModuleCache;
+ llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/false,
+ DefaultModuleCache);
+ llvm::sys::path::append(DefaultModuleCache, "clang-module-cache");
+ CmdArgs.push_back("-fmodule-cache-path");
+ CmdArgs.push_back(Args.MakeArgString(DefaultModuleCache));
+ }
}
/// getARMTargetCPU - Get the (LLVM) name of the ARM cpu we are targeting.