xref: /src/contrib/llvm-project/llvm/lib/Support/SystemUtils.cpp (revision 5ffd83dbcc34f10e07f6d3e968ae6365869615f4)
1009b1c42SEd Schouten //===- SystemUtils.cpp - Utilities for low-level system tasks -------------===//
2009b1c42SEd Schouten //
3e6d15924SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4e6d15924SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5e6d15924SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6009b1c42SEd Schouten //
7009b1c42SEd Schouten //===----------------------------------------------------------------------===//
8009b1c42SEd Schouten //
9009b1c42SEd Schouten // This file contains functions used to do a variety of low-level, often
10009b1c42SEd Schouten // system-specific, tasks.
11009b1c42SEd Schouten //
12009b1c42SEd Schouten //===----------------------------------------------------------------------===//
13009b1c42SEd Schouten 
14009b1c42SEd Schouten #include "llvm/Support/SystemUtils.h"
1559850d08SRoman Divacky #include "llvm/Support/raw_ostream.h"
16009b1c42SEd Schouten using namespace llvm;
17009b1c42SEd Schouten 
CheckBitcodeOutputToConsole(raw_ostream & stream_to_check)18cfca06d7SDimitry Andric bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check) {
1959850d08SRoman Divacky   if (stream_to_check.is_displayed()) {
2059850d08SRoman Divacky     errs() << "WARNING: You're attempting to print out a bitcode file.\n"
21cf099d11SDimitry Andric               "This is inadvisable as it may cause display problems. If\n"
22cf099d11SDimitry Andric               "you REALLY want to taste LLVM bitcode first-hand, you\n"
23cf099d11SDimitry Andric               "can force output with the `-f' option.\n\n";
24009b1c42SEd Schouten     return true;
25009b1c42SEd Schouten   }
26009b1c42SEd Schouten   return false;
27009b1c42SEd Schouten }
28