зеркало из https://github.com/microsoft/clang-1.git
[LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that
the Backend output should be done in binary mode. - I'd appreciate it if someone who has a Windows build could verify this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59221 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
76dba7b67a
Коммит
26fb272713
|
@ -554,7 +554,7 @@ static ExplodedNodeImpl::Auditor* CreateUbiViz() {
|
|||
|
||||
llvm::OwningPtr<llvm::raw_fd_ostream> Stream;
|
||||
std::string filename = Filename.toString();
|
||||
Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), ErrMsg));
|
||||
Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), false, ErrMsg));
|
||||
|
||||
if (!ErrMsg.empty())
|
||||
return 0;
|
||||
|
|
|
@ -170,8 +170,7 @@ bool BackendConsumer::AddEmitPasses(std::string &Error) {
|
|||
OutputFile = Path.toString();
|
||||
}
|
||||
|
||||
// FIXME: Should be binary.
|
||||
AsmOutStream = new raw_fd_ostream(OutputFile.c_str(), Error);
|
||||
AsmOutStream = new raw_fd_ostream(OutputFile.c_str(), true, Error);
|
||||
if (!Error.empty())
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ void clang::CacheTokens(Preprocessor& PP, const std::string& OutFile) {
|
|||
uint32_t idcount = 0;
|
||||
|
||||
std::string ErrMsg;
|
||||
llvm::raw_fd_ostream Out(OutFile.c_str(), ErrMsg);
|
||||
llvm::raw_fd_ostream Out(OutFile.c_str(), true, ErrMsg);
|
||||
|
||||
if (!ErrMsg.empty()) {
|
||||
os << "PCH error: " << ErrMsg << "\n";
|
||||
|
|
|
@ -476,7 +476,7 @@ void clang::DoPrintPreprocessedInput(Preprocessor &PP,
|
|||
|
||||
// Open the output buffer.
|
||||
std::string Err;
|
||||
llvm::raw_fd_ostream OS(OutFile.empty() ? "-" : OutFile.c_str(), Err);
|
||||
llvm::raw_fd_ostream OS(OutFile.empty() ? "-" : OutFile.c_str(), false, Err);
|
||||
if (!Err.empty()) {
|
||||
fprintf(stderr, "%s\n", Err.c_str());
|
||||
exit(1);
|
||||
|
|
|
@ -212,7 +212,7 @@ void clang::RewriteMacrosInInput(Preprocessor &PP,const std::string &InFileName,
|
|||
OutFile = &llvm::outs();
|
||||
} else if (!OutFileName.empty()) {
|
||||
std::string Err;
|
||||
OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(), Err);
|
||||
OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(), false, Err);
|
||||
OwnedStream.reset(OutFile);
|
||||
} else if (InFileName == "-") {
|
||||
OutFile = &llvm::outs();
|
||||
|
@ -221,7 +221,7 @@ void clang::RewriteMacrosInInput(Preprocessor &PP,const std::string &InFileName,
|
|||
Path.eraseSuffix();
|
||||
Path.appendSuffix("cpp");
|
||||
std::string Err;
|
||||
OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), Err);
|
||||
OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), false, Err);
|
||||
OwnedStream.reset(OutFile);
|
||||
}
|
||||
|
||||
|
|
|
@ -4107,7 +4107,7 @@ void RewriteObjC::HandleTranslationUnit(TranslationUnit& TU) {
|
|||
OutFile = &llvm::outs();
|
||||
} else if (!OutFileName.empty()) {
|
||||
std::string Err;
|
||||
OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(), Err);
|
||||
OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(), false, Err);
|
||||
OwnedStream.reset(OutFile);
|
||||
} else if (InFileName == "-") {
|
||||
OutFile = &llvm::outs();
|
||||
|
@ -4116,7 +4116,7 @@ void RewriteObjC::HandleTranslationUnit(TranslationUnit& TU) {
|
|||
Path.eraseSuffix();
|
||||
Path.appendSuffix("cpp");
|
||||
std::string Err;
|
||||
OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), Err);
|
||||
OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), false, Err);
|
||||
OwnedStream.reset(OutFile);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ bool SerializationTest::Serialize(llvm::sys::Path& Filename,
|
|||
{
|
||||
// Pretty-print the decls to a temp file.
|
||||
std::string Err;
|
||||
llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), Err);
|
||||
llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), true, Err);
|
||||
assert (Err.empty() && "Could not open file for printing out decls.");
|
||||
llvm::OwningPtr<ASTConsumer> FilePrinter(CreateASTPrinter(&DeclPP));
|
||||
|
||||
|
@ -89,7 +89,7 @@ bool SerializationTest::Deserialize(llvm::sys::Path& Filename,
|
|||
{
|
||||
// Pretty-print the deserialized decls to a temp file.
|
||||
std::string Err;
|
||||
llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), Err);
|
||||
llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), true, Err);
|
||||
assert (Err.empty() && "Could not open file for printing out decls.");
|
||||
llvm::OwningPtr<ASTConsumer> FilePrinter(CreateASTPrinter(&DeclPP));
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ void CXXRecordDecl::viewInheritance(ASTContext& Context) const {
|
|||
|
||||
llvm::errs() << "Writing '" << Filename.c_str() << "'... ";
|
||||
|
||||
llvm::raw_fd_ostream O(Filename.c_str(), ErrMsg);
|
||||
llvm::raw_fd_ostream O(Filename.c_str(), false, ErrMsg);
|
||||
|
||||
if (ErrMsg.empty()) {
|
||||
InheritanceHierarchyWriter Writer(Context, O);
|
||||
|
|
|
@ -195,7 +195,7 @@ void PlistDiagnostics::HandlePathDiagnostic(const PathDiagnostic* D) {
|
|||
|
||||
// Now create the plist file.
|
||||
std::string ErrMsg;
|
||||
llvm::raw_fd_ostream o(H.toString().c_str(), ErrMsg);
|
||||
llvm::raw_fd_ostream o(H.toString().c_str(), false, ErrMsg);
|
||||
|
||||
if (!ErrMsg.empty()) {
|
||||
llvm::errs() << "warning: could not creat file: " << H.toString() << '\n';
|
||||
|
|
Загрузка…
Ссылка в новой задаче