From 441a488842ee81aa31e09cf2a5dd9fb93ed7e5ea Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 16 Sep 2014 08:39:32 -0700 Subject: [LLVM3.5] Update Kleaver for MemoryBuffer::getFileOrSTDIN changes. --- tools/kleaver/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/kleaver') diff --git a/tools/kleaver/main.cpp b/tools/kleaver/main.cpp index 17a91907..07baee24 100644 --- a/tools/kleaver/main.cpp +++ b/tools/kleaver/main.cpp @@ -457,12 +457,22 @@ int main(int argc, char **argv) { std::string ErrorStr; +#if LLVM_VERSION_CODE < LLVM_VERSION(3,5) OwningPtr MB; error_code ec=MemoryBuffer::getFileOrSTDIN(InputFile.c_str(), MB); if (ec) { llvm::errs() << argv[0] << ": error: " << ec.message() << "\n"; return 1; } +#else + auto MBResult = MemoryBuffer::getFileOrSTDIN(InputFile.c_str()); + if (!MBResult) { + llvm::errs() << argv[0] << ": error: " << MBResult.getError().message() + << "\n"; + return 1; + } + std::unique_ptr &MB = *MBResult; +#endif ExprBuilder *Builder = 0; switch (BuilderKind) { -- cgit 1.4.1