LLVM API Documentation

SystemUtils.h

Go to the documentation of this file.
00001 //===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains functions used to do a variety of low-level, often
00011 // system-specific, tasks.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_SUPPORT_SYSTEMUTILS_H
00016 #define LLVM_SUPPORT_SYSTEMUTILS_H
00017 
00018 #include "llvm/System/Program.h"
00019 
00020 namespace llvm {
00021 
00022 /// Determine if the ostream provided is connected to the std::cout and
00023 /// displayed or not (to a console window). If so, generate a warning message
00024 /// advising against display of bitcode and return true. Otherwise just return
00025 /// false
00026 /// @brief Check for output written to a console
00027 bool CheckBitcodeOutputToConsole(
00028   std::ostream* stream_to_check, ///< The stream to be checked
00029   bool print_warning = true ///< Control whether warnings are printed
00030 );
00031 
00032 /// Determine if the raw_ostream provided is connected to the outs() and
00033 /// displayed or not (to a console window). If so, generate a warning message
00034 /// advising against display of bitcode and return true. Otherwise just return
00035 /// false
00036 /// @brief Check for output written to a console
00037 bool CheckBitcodeOutputToConsole(
00038   raw_ostream* stream_to_check, ///< The stream to be checked
00039   bool print_warning = true ///< Control whether warnings are printed
00040 );
00041 
00042 /// FindExecutable - Find a named executable, giving the argv[0] of program
00043 /// being executed. This allows us to find another LLVM tool if it is built in
00044 /// the same directory.  If the executable cannot be found, return an
00045 /// empty string.
00046 /// @brief Find a named executable.
00047 sys::Path FindExecutable(const std::string &ExeName,
00048                          const char *Argv0, void *MainAddr);
00049 
00050 } // End llvm namespace
00051 
00052 #endif