diff gen/linker.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 a60e7d1ce3ee
children
line wrap: on
line diff
--- a/gen/linker.cpp	Fri Mar 19 09:31:25 2010 +0100
+++ b/gen/linker.cpp	Wed May 19 12:42:32 2010 +0200
@@ -106,7 +106,7 @@
             error("failed to create path to linking output: %s\n%s", exedir.c_str(), errstr.c_str());
             fatal();
         }
-    }    
+    }
 
     // strip debug info
     if (!global.params.symdebug)
@@ -222,13 +222,13 @@
     // find gcc for linking
     llvm::sys::Path gcc = getGcc();
     // get a string version for argv[0]
-    std::string gccStr = gcc.toString();
+    const char* gccStr = gcc.c_str();
 
     // build arguments
     std::vector<const char*> args;
 
     // first the program name ??
-    args.push_back(gccStr.c_str());
+    args.push_back(gccStr);
 
     // object files
     for (int i = 0; i < global.params.objfiles->dim; i++)
@@ -274,7 +274,7 @@
             error("failed to create path to linking output: %s\n%s", exedir.c_str(), errstr.c_str());
             fatal();
         }
-    }    
+    }
 
     // additional linker switches
     for (int i = 0; i < global.params.linkswitches->dim; i++)
@@ -292,7 +292,7 @@
 
     // default libs
     switch(global.params.os) {
-    case OSLinux: 
+    case OSLinux:
     case OSMacOSX:
         args.push_back("-ldl");
         // fallthrough
@@ -330,12 +330,12 @@
     }
 
     Logger::println("Linking with: ");
-    std::vector<const char*>::const_iterator I = args.begin(), E = args.end(); 
+    std::vector<const char*>::const_iterator I = args.begin(), E = args.end();
     Stream logstr = Logger::cout();
     for (; I != E; ++I)
         if (*I)
             logstr << "'" << *I << "'" << " ";
-    logstr << "\n" << std::flush;
+    logstr << "\n"; // FIXME where's flush ?
 
 
     // terminate args list
@@ -349,7 +349,7 @@
             error("message: %s", errstr.c_str());
         return status;
     }
-    
+
     return 0;
 }
 
@@ -375,7 +375,7 @@
     // build arguments
     std::vector<const char*> args;
     // args[0] should be the name of the executable
-    args.push_back(gExePath.toString().c_str());
+    args.push_back(gExePath.c_str());
     // Skip first argument to -run; it's a D source file.
     for (size_t i = 1, length = opts::runargs.size(); i < length; i++)
     {