diff gen/logger.cpp @ 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.cpp	Fri Mar 19 09:31:25 2010 +0100
+++ b/gen/logger.cpp	Wed May 19 12:42:32 2010 +0200
@@ -12,7 +12,7 @@
 
 #include "llvm/GlobalValue.h"
 #include "llvm/Support/Casting.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/raw_os_ostream.h"
 #include "llvm/Assembly/Writer.h"
 
 #include "gen/logger.h"
@@ -27,10 +27,11 @@
     // Constants don't always get their types pretty-printed.
     // (Only treat non-global constants like this, so that e.g. global variables
     // still get their initializers printed)
+    llvm::raw_os_ostream raw(OS);
     if (llvm::isa<llvm::Constant>(V) && !llvm::isa<llvm::GlobalValue>(V))
-        llvm::WriteAsOperand(OS, &V, true, gIR->module);
+        llvm::WriteAsOperand(raw, &V, true, gIR->module);
     else
-        OS << V;
+        V.print(raw);
 }
 
 namespace Logger