Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove wrapped_clang params files after use #12896

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions tools/osx/crosstool/wrapped_clang.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,6 @@ std::vector<const char *> ConvertToCArgs(const std::vector<std::string> &args) {
return c_args;
}

// Turn our current process into a new process. Avoids fork overhead.
// Never returns.
void ExecProcess(const std::vector<std::string> &args) {
std::vector<const char *> exec_argv = ConvertToCArgs(args);
execv(args[0].c_str(), const_cast<char **>(exec_argv.data()));
std::cerr << "Error executing child process.'" << args[0] << "'. "
<< strerror(errno) << "\n";
abort();
}

// Spawns a subprocess for given arguments args. The first argument is used
// for the executable path.
void RunSubProcess(const std::vector<std::string> &args) {
Expand Down Expand Up @@ -407,19 +397,13 @@ int main(int argc, char *argv[]) {
}
}

RunSubProcess(invocation_args);
if (!postprocess) {
ExecProcess(invocation_args);
std::cerr << "ExecProcess should not return. Please fix!\n";
abort();
return 0;
}

RunSubProcess(invocation_args);

std::vector<std::string> dsymutil_args = {
"/usr/bin/xcrun", "dsymutil", linked_binary, "-o", dsym_path, "--flat"};
ExecProcess(dsymutil_args);
std::cerr << "ExecProcess should not return. Please fix!\n";
abort();

RunSubProcess(dsymutil_args);
return 0;
}