blob: 7fa6ae3f61990ccb43e0e2258377a58c7491bb33 [file] [log] [blame]
Misha Brukman4b585812004-06-18 15:38:49 +00001//===- SystemUtils.cpp - Utilities for low-level system tasks -------------===//
Misha Brukman10468d82005-04-21 22:55:34 +00002//
John Criswell482202a2003-10-20 19:43:21 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukman10468d82005-04-21 22:55:34 +00007//
John Criswell482202a2003-10-20 19:43:21 +00008//===----------------------------------------------------------------------===//
Chris Lattnerde4aa4c2002-12-23 23:50:16 +00009//
10// This file contains functions used to do a variety of low-level, often
11// system-specific, tasks.
12//
13//===----------------------------------------------------------------------===//
14
Reid Spencer7c16caa2004-09-01 22:55:40 +000015#include "llvm/Support/SystemUtils.h"
Chris Lattnerc521f542009-08-23 22:45:37 +000016#include "llvm/Support/raw_ostream.h"
Chris Lattnerc9499b62003-12-14 21:35:53 +000017using namespace llvm;
Brian Gaeke960707c2003-11-11 22:41:34 +000018
Chris Lattnerb9f25f92009-08-23 21:36:09 +000019bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check,
Dan Gohman69353322009-07-15 17:04:50 +000020 bool print_warning) {
Dan Gohmane5929232009-09-11 20:46:33 +000021 if (stream_to_check.is_displayed()) {
Dan Gohman69353322009-07-15 17:04:50 +000022 if (print_warning) {
Chris Lattnerb9f25f92009-08-23 21:36:09 +000023 errs() << "WARNING: You're attempting to print out a bitcode file.\n"
Dan Gohman0baea2a2010-11-03 00:24:33 +000024 "This is inadvisable as it may cause display problems. If\n"
25 "you REALLY want to taste LLVM bitcode first-hand, you\n"
26 "can force output with the `-f' option.\n\n";
Reid Spencer4e8dd442005-01-02 00:10:03 +000027 }
Reid Spencer1263cfd2005-01-01 23:56:20 +000028 return true;
29 }
Brian Gaeke5ade5012004-04-02 21:26:04 +000030 return false;
Chris Lattner454e1832004-04-02 05:04:03 +000031}