[polly] r212412 - Update for llvm api change.

Rafael Espindola rafael.espindola at gmail.com
Sun Jul 6 11:11:46 PDT 2014


Author: rafael
Date: Sun Jul  6 13:11:46 2014
New Revision: 212412

URL: http://llvm.org/viewvc/llvm-project?rev=212412&view=rev
Log:
Update for llvm api change.

Modified:
    polly/trunk/lib/Exchange/JSONExporter.cpp

Modified: polly/trunk/lib/Exchange/JSONExporter.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/JSONExporter.cpp?rev=212412&r1=212411&r2=212412&view=diff
==============================================================================
--- polly/trunk/lib/Exchange/JSONExporter.cpp (original)
+++ polly/trunk/lib/Exchange/JSONExporter.cpp Sun Jul  6 13:11:46 2014
@@ -191,8 +191,9 @@ bool JSONImporter::runOnScop(Scop &scop)
   std::string FunctionName = R.getEntry()->getParent()->getName();
   errs() << "Reading JScop '" << R.getNameStr() << "' in function '"
          << FunctionName << "' from '" << FileName << "'.\n";
-  std::unique_ptr<MemoryBuffer> result;
-  std::error_code ec = MemoryBuffer::getFile(FileName, result);
+  ErrorOr<std::unique_ptr<MemoryBuffer>> result =
+      MemoryBuffer::getFile(FileName);
+  std::error_code ec = result.getError();
 
   if (ec) {
     errs() << "File could not be read: " << ec.message() << "\n";
@@ -202,7 +203,7 @@ bool JSONImporter::runOnScop(Scop &scop)
   Json::Reader reader;
   Json::Value jscop;
 
-  bool parsingSuccessful = reader.parse(result->getBufferStart(), jscop);
+  bool parsingSuccessful = reader.parse(result.get()->getBufferStart(), jscop);
 
   if (!parsingSuccessful) {
     errs() << "JSCoP file could not be parsed\n";





More information about the llvm-commits mailing list