[PATCH] C API: don't assert in LLVMTargetMachineEmitToFile on	nonexistent file
    Peter Zotov 
    whitequark at whitequark.org
       
    Sat Oct 12 10:52:10 PDT 2013
    
    
  
  Removed whitespace changes.
http://llvm-reviews.chandlerc.com/D1909
CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D1909?vs=4860&id=4882#toc
Files:
  lib/Target/TargetMachineC.cpp
Index: lib/Target/TargetMachineC.cpp
===================================================================
--- lib/Target/TargetMachineC.cpp
+++ lib/Target/TargetMachineC.cpp
@@ -205,11 +205,11 @@
   char* Filename, LLVMCodeGenFileType codegen, char** ErrorMessage) {
   std::string error;
   raw_fd_ostream dest(Filename, error, sys::fs::F_Binary);
-  formatted_raw_ostream destf(dest);
   if (!error.empty()) {
     *ErrorMessage = strdup(error.c_str());
     return true;
   }
+  formatted_raw_ostream destf(dest);
   bool Result = LLVMTargetMachineEmit(T, M, destf, codegen, ErrorMessage);
   dest.flush();
   return Result;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1909.2.patch
Type: text/x-patch
Size: 627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131012/b1b95c8e/attachment.bin>
    
    
More information about the llvm-commits
mailing list