LLVM  8.0.1
SystemUtils.cpp
Go to the documentation of this file.
1 //===- SystemUtils.cpp - Utilities for low-level system tasks -------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains functions used to do a variety of low-level, often
11 // system-specific, tasks.
12 //
13 //===----------------------------------------------------------------------===//
14 
17 using namespace llvm;
18 
20  bool print_warning) {
21  if (stream_to_check.is_displayed()) {
22  if (print_warning) {
23  errs() << "WARNING: You're attempting to print out a bitcode file.\n"
24  "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";
27  }
28  return true;
29  }
30  return false;
31 }
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
This class represents lattice values for constants.
Definition: AllocatorList.h:24
bool CheckBitcodeOutputToConsole(raw_ostream &stream_to_check, bool print_warning=true)
Determine if the raw_ostream provided is connected to a terminal.
Definition: SystemUtils.cpp:19
virtual bool is_displayed() const
This function determines if this stream is connected to a "tty" or "console" window.
Definition: raw_ostream.h:276
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46