Define LLVM_GLOBAL_VISIBILITY to be __declspec(dllexport) on
[oota-llvm.git] / lib / AsmParser / Parser.cpp
index 331a23323b517214156d78b62505d3ec1ea3a334..e7cef9b5c3c587af068dffdeb8af089c7e9f7f36 100644 (file)
@@ -44,8 +44,8 @@ Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err,
   std::string ErrorStr;
   MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr);
   if (F == 0) {
-    Err = SMDiagnostic("", -1, -1,
-                       "Could not open input file '" + Filename + "'", "");
+    Err = SMDiagnostic(Filename,
+                       "Could not open input file: " + ErrorStr);
     return 0;
   }
 
@@ -55,7 +55,7 @@ Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err,
 Module *llvm::ParseAssemblyString(const char *AsmString, Module *M,
                                   SMDiagnostic &Err, LLVMContext &Context) {
   MemoryBuffer *F =
-    MemoryBuffer::getMemBuffer(AsmString, AsmString+strlen(AsmString),
+    MemoryBuffer::getMemBuffer(StringRef(AsmString, strlen(AsmString)),
                                "<string>");
 
   return ParseAssembly(F, M, Err, Context);