@@ -37,31 +37,24 @@ struct InputArgs final : public Intel::CM::ClangFE::IInputArgs {
37
37
};
38
38
39
39
using StringVect_t = std::vector<std::string>;
40
- inline StringVect_t
41
- convertBackendArgsToVcOpts (const StringVect_t &BackendArgs) {
42
- std::vector<std::string> VcOpts;
43
- std::vector<std::string> AllFinalizerOpts ;
40
+ inline std::pair< StringVect_t, StringVect_t>
41
+ convertBackendArgsToVcAndFinalizerOpts (const StringVect_t &BackendArgs) {
42
+ StringVect_t VcOpts;
43
+ StringVect_t FinalizerOpts ;
44
44
45
45
const std::string FinalizerOptPrefix = " -finalizer-opts=" ;
46
46
auto IsFinalizerOpts = [&FinalizerOptPrefix](const std::string &Opt) {
47
47
return Opt.find (FinalizerOptPrefix) == 0 ;
48
48
};
49
49
std::partition_copy (BackendArgs.begin (), BackendArgs.end (),
50
- std::back_inserter (AllFinalizerOpts ),
50
+ std::back_inserter (FinalizerOpts ),
51
51
std::back_inserter (VcOpts), IsFinalizerOpts);
52
- std::transform (AllFinalizerOpts .begin (), AllFinalizerOpts .end (),
53
- AllFinalizerOpts .begin (),
52
+ std::transform (FinalizerOpts .begin (), FinalizerOpts .end (),
53
+ FinalizerOpts .begin (),
54
54
[&FinalizerOptPrefix](const std::string &Opt) {
55
55
return Opt.substr (FinalizerOptPrefix.size ());
56
56
});
57
- if (!AllFinalizerOpts.empty ()) {
58
- // TODO: we should escape the joined finalizer options
59
- VcOpts.emplace_back ((llvm::StringRef (FinalizerOptPrefix) + " \" " +
60
- llvm::join (AllFinalizerOpts, " " ) + " \" " )
61
- .str ());
62
- }
63
-
64
- return VcOpts;
57
+ return {VcOpts, FinalizerOpts};
65
58
}
66
59
67
60
using IOutputArgs = Intel::CM::ClangFE::IOutputArgs;
0 commit comments