1ebb0faabd3df5eab24178da692b75aa79b0d65c7Misha Brukman//===- SystemUtils.cpp - Utilities for low-level system tasks -------------===//
2f976c856fcc5055f3fc7d9f070d72c2d027c1d9dMisha Brukman//
3b576c94c15af9a440f69d9d03c2afead7971118cJohn Criswell//                     The LLVM Compiler Infrastructure
4b576c94c15af9a440f69d9d03c2afead7971118cJohn Criswell//
54ee451de366474b9c228b4e5fa573795a715216dChris Lattner// This file is distributed under the University of Illinois Open Source
64ee451de366474b9c228b4e5fa573795a715216dChris Lattner// License. See LICENSE.TXT for details.
7f976c856fcc5055f3fc7d9f070d72c2d027c1d9dMisha Brukman//
8b576c94c15af9a440f69d9d03c2afead7971118cJohn Criswell//===----------------------------------------------------------------------===//
94a10645c70199c8d8567fbc46312158c419720abChris Lattner//
104a10645c70199c8d8567fbc46312158c419720abChris Lattner// This file contains functions used to do a variety of low-level, often
114a10645c70199c8d8567fbc46312158c419720abChris Lattner// system-specific, tasks.
124a10645c70199c8d8567fbc46312158c419720abChris Lattner//
134a10645c70199c8d8567fbc46312158c419720abChris Lattner//===----------------------------------------------------------------------===//
144a10645c70199c8d8567fbc46312158c419720abChris Lattner
15551ccae044b0ff658fe629dd67edd5ffe75d10e8Reid Spencer#include "llvm/Support/SystemUtils.h"
161f6efa3996dd1929fbc129203ce5009b620e6969Michael J. Spencer#include "llvm/Support/Process.h"
171f6efa3996dd1929fbc129203ce5009b620e6969Michael J. Spencer#include "llvm/Support/Program.h"
1874382b7c699120fbec5cb5603c9cf4212eb37f06Chris Lattner#include "llvm/Support/raw_ostream.h"
192cdd21c2e4d855500dfb53f77aa74da53ccf9de6Chris Lattnerusing namespace llvm;
20d0fde30ce850b78371fd1386338350591f9ff494Brian Gaeke
21b683ea4712836e22b98d24bf8e40e599224d024eChris Lattnerbool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check,
22d890de10af6a4d01fe0b35f09ccd674d771e4732Dan Gohman                                       bool print_warning) {
23ec080467f5b322441055de1f6cd4f08edc23d7dfDan Gohman  if (stream_to_check.is_displayed()) {
24d890de10af6a4d01fe0b35f09ccd674d771e4732Dan Gohman    if (print_warning) {
25b683ea4712836e22b98d24bf8e40e599224d024eChris Lattner      errs() << "WARNING: You're attempting to print out a bitcode file.\n"
26303f350f7d4fffac042d6e36ca35f751ab62488bDan Gohman                "This is inadvisable as it may cause display problems. If\n"
27303f350f7d4fffac042d6e36ca35f751ab62488bDan Gohman                "you REALLY want to taste LLVM bitcode first-hand, you\n"
28303f350f7d4fffac042d6e36ca35f751ab62488bDan Gohman                "can force output with the `-f' option.\n\n";
2952b50a64ecd31ebb03e742d8ad6b6a86b541a53dReid Spencer    }
30436f23ebf58418611f798faf7e00de05c7a42e21Reid Spencer    return true;
31436f23ebf58418611f798faf7e00de05c7a42e21Reid Spencer  }
328507ecb36d8b755671861d0b3550c66a322d3f04Brian Gaeke  return false;
33b234d460b25fea41531cd6edf3da67ec1601233bChris Lattner}
34