diff gen/logger.h @ 1650:40bd4a0d4870

Update to work with LLVM 2.7. Removed use of dyn_cast, llvm no compiles without exceptions and rtti by default. We do need exceptions for the libconfig stuff, but rtti isn't necessary (anymore). Debug info needs to be rewritten, as in LLVM 2.7 the format has completely changed. To have something to look at while rewriting, the old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means that you have to define this to compile at the moment. Updated tango 0.99.9 patch to include updated EH runtime code, which is needed for LLVM 2.7 as well.
author Tomas Lindquist Olsen
date Wed, 19 May 2010 12:42:32 +0200
parents 2292878925f4
children
line wrap: on
line diff
--- a/gen/logger.h	Fri Mar 19 09:31:25 2010 +0100
+++ b/gen/logger.h	Wed May 19 12:42:32 2010 +0200
@@ -20,36 +20,38 @@
 
 class Stream {
     std::ostream* OS;
-    
+
 public:
     Stream() : OS(0) {}
     Stream(std::ostream* S) : OS(S) {}
     Stream(std::ostream& S) : OS(&S) {}
-    
+
+    /*
     Stream operator << (std::ios_base &(*Func)(std::ios_base&)) {
       if (OS) *OS << Func;
       return *this;
     }
-    
+    */
+
     Stream operator << (std::ostream &(*Func)(std::ostream&)) {
-      if (OS) *OS << Func;
+      if (OS) Func(*OS);
       return *this;
     }
-    
+
     template<typename Ty>
     Stream& operator << (const Ty& Thing) {
         if (OS)
             Writer<Ty, sizeof(sfinae_bait(Thing))>::write(*OS, Thing);
         return *this;
     }
-    
+
 private:
     // Implementation details to treat llvm::Value, llvm::Type and their
     // subclasses specially (to pretty-print types).
-    
+
     static void writeType(std::ostream& OS, const llvm::Type& Ty);
     static void writeValue(std::ostream& OS, const llvm::Value& Ty);
-    
+
     template<typename Ty, int N> friend struct Writer;
     // error: function template partial specialization is not allowed
     // So I guess type partial specialization + member function will have to do...
@@ -59,7 +61,7 @@
             OS << Thing;
         }
     };
-    
+
     template<typename Ty>
     struct Writer<Ty, 1> {
         static void write(std::ostream& OS, const llvm::Type& Thing) {
@@ -69,7 +71,7 @@
             Stream::writeValue(OS, Thing);
         }
     };
-    
+
     // NOT IMPLEMENTED
     char sfinae_bait(const llvm::Type&);
     char sfinae_bait(const llvm::Value&);