llvm.org GIT mirror llvm / c52b128
opening "-" automatically yields stdout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54863 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
1 changed file(s) with 7 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3333 /// information about the error is put into ErrorInfo, and the stream should
3434 /// be immediately destroyed.
3535 raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo) {
36 // Handle "-" as stdout.
37 if (Filename[0] == '-' && Filename[1] == 0) {
38 FD = STDOUT_FILENO;
39 ShouldClose = false;
40 return;
41 }
42
3643 FD = open(Filename, O_WRONLY|O_CREAT|O_TRUNC, 0644);
3744 if (FD < 0) {
3845 ErrorInfo = "Error opening output file '" + std::string(Filename) + "'";