@@ -70,11 +70,16 @@ ConfigImpl(
70
70
llvm::StringRef workingDir_,
71
71
llvm::StringRef addonsDir_,
72
72
llvm::StringRef configYaml_,
73
- llvm::StringRef extraYaml_)
73
+ llvm::StringRef extraYaml_,
74
+ ConfigImpl const * base)
74
75
{
75
76
namespace fs = llvm::sys::fs;
76
77
namespace path = llvm::sys::path;
77
78
79
+ // copy the base settings if present
80
+ if (base)
81
+ settings_ = base->settings_ ;
82
+
78
83
if (! files::isAbsolute (workingDir_))
79
84
formatError (" working path \" {}\" is not absolute" , workingDir_).Throw ();
80
85
settings_.workingDir = files::makeDirsy (files::normalizePath (workingDir_));
@@ -187,7 +192,7 @@ createConfigFromYAML(
187
192
try
188
193
{
189
194
auto config = std::make_shared<ConfigImpl>(
190
- workingDir, addonsDir, configYaml, extraYaml);
195
+ workingDir, addonsDir, configYaml, extraYaml, nullptr );
191
196
return config;
192
197
}
193
198
catch (Exception const & ex)
@@ -200,7 +205,8 @@ Expected<std::shared_ptr<ConfigImpl const>>
200
205
loadConfigFile (
201
206
std::string_view configFilePath,
202
207
std::string_view addonsDir,
203
- std::string_view extraYaml)
208
+ std::string_view extraYaml,
209
+ std::shared_ptr<ConfigImpl const > base)
204
210
{
205
211
namespace fs = llvm::sys::fs;
206
212
namespace path = llvm::sys::path;
@@ -222,7 +228,7 @@ loadConfigFile(
222
228
try
223
229
{
224
230
auto config = std::make_shared<ConfigImpl>(
225
- workingDir, addonsDir, *text, extraYaml);
231
+ workingDir, addonsDir, *text, extraYaml, base. get () );
226
232
return config;
227
233
}
228
234
catch (Exception const & ex)
0 commit comments