about summary refs log tree commit diff homepage
path: root/tools/kleaver
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2014-09-16 08:39:32 -0700
committerDaniel Dunbar <daniel@zuster.org>2014-09-16 08:39:32 -0700
commit441a488842ee81aa31e09cf2a5dd9fb93ed7e5ea (patch)
tree96fb74328ff01069a045be034428912080d555b7 /tools/kleaver
parentfbae38cdf9ad3b7ebf7501c46028c3edd6e39b53 (diff)
downloadklee-441a488842ee81aa31e09cf2a5dd9fb93ed7e5ea.tar.gz
[LLVM3.5] Update Kleaver for MemoryBuffer::getFileOrSTDIN changes.
Diffstat (limited to 'tools/kleaver')
-rw-r--r--tools/kleaver/main.cpp10
1 files changed, 10 insertions, 0 deletions
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<MemoryBuffer> 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<MemoryBuffer> &MB = *MBResult;
+#endif
   
   ExprBuilder *Builder = 0;
   switch (BuilderKind) {