Misha Brukman | 4b58581 | 2004-06-18 15:38:49 +0000 | [diff] [blame] | 1 | //===- SystemUtils.cpp - Utilities for low-level system tasks -------------===// |
Misha Brukman | 10468d8 | 2005-04-21 22:55:34 +0000 | [diff] [blame] | 2 | // |
John Criswell | 482202a | 2003-10-20 19:43:21 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | 10468d8 | 2005-04-21 22:55:34 +0000 | [diff] [blame] | 7 | // |
John Criswell | 482202a | 2003-10-20 19:43:21 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | de4aa4c | 2002-12-23 23:50:16 +0000 | [diff] [blame] | 9 | // |
| 10 | // This file contains functions used to do a variety of low-level, often |
| 11 | // system-specific, tasks. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Reid Spencer | 7c16caa | 2004-09-01 22:55:40 +0000 | [diff] [blame] | 15 | #include "llvm/Support/SystemUtils.h" |
Michael J. Spencer | 447762d | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 16 | #include "llvm/Support/Process.h" |
| 17 | #include "llvm/Support/Program.h" |
Chris Lattner | c521f54 | 2009-08-23 22:45:37 +0000 | [diff] [blame] | 18 | #include "llvm/Support/raw_ostream.h" |
Chris Lattner | c9499b6 | 2003-12-14 21:35:53 +0000 | [diff] [blame] | 19 | using namespace llvm; |
Brian Gaeke | 960707c | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 20 | |
Chris Lattner | b9f25f9 | 2009-08-23 21:36:09 +0000 | [diff] [blame] | 21 | bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check, |
Dan Gohman | 6935332 | 2009-07-15 17:04:50 +0000 | [diff] [blame] | 22 | bool print_warning) { |
Dan Gohman | e592923 | 2009-09-11 20:46:33 +0000 | [diff] [blame] | 23 | if (stream_to_check.is_displayed()) { |
Dan Gohman | 6935332 | 2009-07-15 17:04:50 +0000 | [diff] [blame] | 24 | if (print_warning) { |
Chris Lattner | b9f25f9 | 2009-08-23 21:36:09 +0000 | [diff] [blame] | 25 | errs() << "WARNING: You're attempting to print out a bitcode file.\n" |
Dan Gohman | 0baea2a | 2010-11-03 00:24:33 +0000 | [diff] [blame] | 26 | "This is inadvisable as it may cause display problems. If\n" |
| 27 | "you REALLY want to taste LLVM bitcode first-hand, you\n" |
| 28 | "can force output with the `-f' option.\n\n"; |
Reid Spencer | 4e8dd44 | 2005-01-02 00:10:03 +0000 | [diff] [blame] | 29 | } |
Reid Spencer | 1263cfd | 2005-01-01 23:56:20 +0000 | [diff] [blame] | 30 | return true; |
| 31 | } |
Brian Gaeke | 5ade501 | 2004-04-02 21:26:04 +0000 | [diff] [blame] | 32 | return false; |
Chris Lattner | 454e183 | 2004-04-02 05:04:03 +0000 | [diff] [blame] | 33 | } |