Wrap const MDNode * inside DIDescriptor.
[oota-llvm.git] / tools / lto / LTOCodeGenerator.cpp
index bc65b3afc28a369044542f0f40e4637dac845955..10105921c4eb5ff6b5ed631d820b702f1e2a9448 100644 (file)
@@ -328,7 +328,7 @@ void LTOCodeGenerator::applyScopeRestrictions() {
     }
     for (Module::global_iterator v = mergedModule->global_begin(), 
          e = mergedModule->global_end(); v !=  e; ++v) {
-      if (v->isDeclaration() &&
+      if (!v->isDeclaration() &&
           _mustPreserveSymbols.count(mangler.getNameWithPrefix(v)))
         mustPreserveList.push_back(::strdup(v->getNameStr().c_str()));
     }
@@ -353,24 +353,10 @@ bool LTOCodeGenerator::generateAssemblyCode(formatted_raw_ostream& out,
 
     Module* mergedModule = _linker.getModule();
 
-    // If target supports exception handling then enable it now.
-    switch (_target->getMCAsmInfo()->getExceptionHandlingType()) {
-    case ExceptionHandling::Dwarf:
-      llvm::DwarfExceptionHandling = true;
-      break;
-    case ExceptionHandling::SjLj:
-      llvm::SjLjExceptionHandling = true;
-      break;
-    case ExceptionHandling::None:
-      break;
-    default:
-      assert (0 && "Unknown exception handling model!");
-    }
-
     // if options were requested, set them
     if ( !_codegenOptions.empty() )
         cl::ParseCommandLineOptions(_codegenOptions.size(), 
-                                                (char**)&_codegenOptions[0]);
+                                    const_cast<char **>(&_codegenOptions[0]));
 
     // Instantiate the pass manager to organize the passes.
     PassManager passes;