diff options
Diffstat (limited to 'llvm/lib/Target/TargetMachineC.cpp')
-rw-r--r-- | llvm/lib/Target/TargetMachineC.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/TargetMachineC.cpp b/llvm/lib/Target/TargetMachineC.cpp index 702b915c6cd..598783b1be1 100644 --- a/llvm/lib/Target/TargetMachineC.cpp +++ b/llvm/lib/Target/TargetMachineC.cpp @@ -223,10 +223,10 @@ static LLVMBool LLVMTargetMachineEmit(LLVMTargetMachineRef T, LLVMModuleRef M, LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, char* Filename, LLVMCodeGenFileType codegen, char** ErrorMessage) { - std::string error; - raw_fd_ostream dest(Filename, error, sys::fs::F_None); - if (!error.empty()) { - *ErrorMessage = strdup(error.c_str()); + std::error_code EC; + raw_fd_ostream dest(Filename, EC, sys::fs::F_None); + if (EC) { + *ErrorMessage = strdup(EC.message().c_str()); return true; } formatted_raw_ostream destf(dest); |