1193323Sed//===- SystemUtils.cpp - Utilities for low-level system tasks -------------===//
2193323Sed//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6193323Sed//
7193323Sed//===----------------------------------------------------------------------===//
8193323Sed//
9193323Sed// This file contains functions used to do a variety of low-level, often
10193323Sed// system-specific, tasks.
11193323Sed//
12193323Sed//===----------------------------------------------------------------------===//
13193323Sed
14193323Sed#include "llvm/Support/SystemUtils.h"
15198090Srdivacky#include "llvm/Support/raw_ostream.h"
16193323Sedusing namespace llvm;
17193323Sed
18198090Srdivackybool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check,
19193323Sed                                       bool print_warning) {
20198090Srdivacky  if (stream_to_check.is_displayed()) {
21193323Sed    if (print_warning) {
22198090Srdivacky      errs() << "WARNING: You're attempting to print out a bitcode file.\n"
23218893Sdim                "This is inadvisable as it may cause display problems. If\n"
24218893Sdim                "you REALLY want to taste LLVM bitcode first-hand, you\n"
25218893Sdim                "can force output with the `-f' option.\n\n";
26193323Sed    }
27193323Sed    return true;
28193323Sed  }
29193323Sed  return false;
30193323Sed}
31