Mercurial > projects > ldc
view gen/logger.h @ 1415:bac3931b3de3
Fix a behavioral change accidentally introduced by the move to the LLVM
commandline system: `-output-(bc|ll|s)` used to disable generation of an object
file unless explicitly requested with `-output-o`. Now they do so again.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sat, 23 May 2009 20:57:22 +0200 |
parents | 229e02867307 |
children | 2292878925f4 |
line wrap: on
line source
#ifndef _llvmd_gen_logger_h_ #define _llvmd_gen_logger_h_ #include "llvm/Support/Streams.h" #ifndef IS_PRINTF # ifdef __GNUC__ # define IS_PRINTF(FMTARG) __attribute((__format__ (__printf__, (FMTARG), (FMTARG)+1) )) # else # define IS_PRINTF(FMTARG) # endif #endif struct Loc; namespace Logger { void indent(); void undent(); llvm::OStream cout(); void println(const char* fmt, ...) IS_PRINTF(1); void print(const char* fmt, ...) IS_PRINTF(1); void enable(); void disable(); bool enabled(); void attention(Loc loc, const char* fmt, ...) IS_PRINTF(2); struct LoggerScope { LoggerScope() { Logger::indent(); } ~LoggerScope() { Logger::undent(); } }; } #define LOG_SCOPE Logger::LoggerScope _logscope; #define IF_LOG if (Logger::enabled()) #endif