2004-06-18 15:38:49 +00:00
|
|
|
//===- SystemUtils.cpp - Utilities for low-level system tasks -------------===//
|
2005-04-21 22:55:34 +00:00
|
|
|
//
|
2003-10-20 19:43:21 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 22:55:34 +00:00
|
|
|
//
|
2003-10-20 19:43:21 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2002-12-23 23:50:16 +00:00
|
|
|
//
|
|
|
|
// This file contains functions used to do a variety of low-level, often
|
|
|
|
// system-specific, tasks.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-09-01 22:55:40 +00:00
|
|
|
#include "llvm/Support/SystemUtils.h"
|
2009-08-23 22:45:37 +00:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2003-12-14 21:35:53 +00:00
|
|
|
using namespace llvm;
|
2003-11-11 22:41:34 +00:00
|
|
|
|
2009-08-23 21:36:09 +00:00
|
|
|
bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check,
|
2009-07-15 17:04:50 +00:00
|
|
|
bool print_warning) {
|
2009-09-11 20:46:33 +00:00
|
|
|
if (stream_to_check.is_displayed()) {
|
2009-07-15 17:04:50 +00:00
|
|
|
if (print_warning) {
|
2009-08-23 21:36:09 +00:00
|
|
|
errs() << "WARNING: You're attempting to print out a bitcode file.\n"
|
2010-11-03 00:24:33 +00:00
|
|
|
"This is inadvisable as it may cause display problems. If\n"
|
|
|
|
"you REALLY want to taste LLVM bitcode first-hand, you\n"
|
|
|
|
"can force output with the `-f' option.\n\n";
|
2005-01-02 00:10:03 +00:00
|
|
|
}
|
2005-01-01 23:56:20 +00:00
|
|
|
return true;
|
|
|
|
}
|
2004-04-02 21:26:04 +00:00
|
|
|
return false;
|
2004-04-02 05:04:03 +00:00
|
|
|
}
|