mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 10:55:58 +08:00
Make File option flags consistent for Python API
Summary: Fixes SBCommandReturnObject::SetImmediateOutputFile() and SBCommandReturnObject::SetImmediateOutputFile() for files opened with "a" or "a+" by resolving inconsistencies between File and our Python parsing of file objects. Reviewers: granata.enrico, Eugene.Zelenko, jingham, clayborg Subscribers: lldb-commits, sas Differential Revision: http://reviews.llvm.org/D18228 Change by Francis Ricci <fjricci@fb.com> llvm-svn: 264351
This commit is contained in:
@@ -1253,10 +1253,10 @@ PythonFile::GetOptionsFromMode(llvm::StringRef mode)
|
||||
return llvm::StringSwitch<uint32_t>(mode.str().c_str())
|
||||
.Case("r", File::eOpenOptionRead)
|
||||
.Case("w", File::eOpenOptionWrite)
|
||||
.Case("a", File::eOpenOptionAppend|File::eOpenOptionCanCreate)
|
||||
.Case("a", File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
|
||||
.Case("r+", File::eOpenOptionRead|File::eOpenOptionWrite)
|
||||
.Case("w+", File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
|
||||
.Case("a+", File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
|
||||
.Case("a+", File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
|
||||
.Default(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user