2004-06-18 23:38:49 +08:00
|
|
|
//===- SystemUtils.cpp - Utilities for low-level system tasks -------------===//
|
2005-04-22 06:55:34 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2005-04-22 06:55:34 +08:00
|
|
|
//
|
2003-10-21 03:43:21 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2002-12-24 07:50:16 +08:00
|
|
|
//
|
|
|
|
// This file contains functions used to do a variety of low-level, often
|
|
|
|
// system-specific, tasks.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-09-02 06:55:40 +08:00
|
|
|
#include "llvm/Support/SystemUtils.h"
|
2009-08-24 06:45:37 +08:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2003-12-15 05:35:53 +08:00
|
|
|
using namespace llvm;
|
2003-11-12 06:41:34 +08:00
|
|
|
|
2009-08-24 05:36:09 +08:00
|
|
|
bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check,
|
2009-07-16 01:04:50 +08:00
|
|
|
bool print_warning) {
|
2009-09-12 04:46:33 +08:00
|
|
|
if (stream_to_check.is_displayed()) {
|
2009-07-16 01:04:50 +08:00
|
|
|
if (print_warning) {
|
2009-08-24 05:36:09 +08:00
|
|
|
errs() << "WARNING: You're attempting to print out a bitcode file.\n"
|
2010-11-03 08:24:33 +08: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 08:10:03 +08:00
|
|
|
}
|
2005-01-02 07:56:20 +08:00
|
|
|
return true;
|
|
|
|
}
|
2004-04-03 05:26:04 +08:00
|
|
|
return false;
|
2004-04-02 13:04:03 +08:00
|
|
|
}
|