LLVM API Documentation
00001 //===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file was developed by the LLVM research group and is distributed under 00006 // the University of Illinois Open Source 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 bytecode and return true. Otherwise just return 00025 /// false 00026 /// @brief Check for output written to a console 00027 bool CheckBytecodeOutputToConsole( 00028 std::ostream* stream_to_check, ///< The stream to be checked 00029 bool print_warning = true ///< Control whether warnings are printed 00030 ); 00031 00032 /// FindExecutable - Find a named executable, giving the argv[0] of program 00033 /// being executed. This allows us to find another LLVM tool if it is built into 00034 /// the same directory, but that directory is neither the current directory, nor 00035 /// in the PATH. If the executable cannot be found, return an empty string. 00036 /// @brief Find a named executable. 00037 sys::Path FindExecutable(const std::string &ExeName, 00038 const std::string &ProgramPath); 00039 00040 } // End llvm namespace 00041 00042 #endif