Skip to content

Commit b85de8b

Browse files
committed
Receive write destination in cpp-rule-preprocessor
1 parent 15de03b commit b85de8b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

cpp2rust/cpp_rule_preprocessor.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,10 +779,15 @@ llvm::cl::OptionCategory cat("cpp-rule-preprocessor options");
779779
llvm::cl::opt<std::string>
780780
SrcDir("dir",
781781
llvm::cl::desc("Path to a rule directory containing src.c and/or "
782-
"src.cpp. ir_src.json is written into this dir."),
782+
"src.cpp."),
783783
llvm::cl::value_desc("rule-dir"), llvm::cl::Required,
784784
llvm::cl::cat(cat));
785785

786+
llvm::cl::opt<std::string>
787+
OutPath("out", llvm::cl::desc("Path of the ir_src.json file to write."),
788+
llvm::cl::value_desc("out.json"), llvm::cl::Required,
789+
llvm::cl::cat(cat));
790+
786791
} // namespace
787792

788793
int main(int argc, char *argv[]) {
@@ -809,7 +814,7 @@ int main(int argc, char *argv[]) {
809814
}
810815
}
811816

812-
auto out_path = dir / "ir_src.json";
817+
fs::path out_path = OutPath.getValue();
813818
std::error_code ec;
814819
llvm::raw_fd_ostream out(out_path.string(), ec);
815820
if (ec) {

0 commit comments

Comments
 (0)