Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions clang-tools-extra/clang-doc/HTMLGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ HTMLGenerator::generateDocs(StringRef RootDir,
for (const auto &Group : FileToInfos) {
std::error_code FileErr;
llvm::raw_fd_ostream InfoOS(Group.getKey(), FileErr,
llvm::sys::fs::OF_None);
llvm::sys::fs::OF_Text);
if (FileErr) {
return llvm::createStringError(FileErr, "Error opening file '%s'",
Group.getKey().str().c_str());
Expand Down Expand Up @@ -1047,7 +1047,7 @@ static llvm::Error serializeIndex(ClangDocContext &CDCtx) {
llvm::SmallString<128> FilePath;
llvm::sys::path::native(CDCtx.OutDirectory, FilePath);
llvm::sys::path::append(FilePath, "index_json.js");
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_None);
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_Text);
if (FileErr != OK) {
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"error creating index file: " +
Expand Down Expand Up @@ -1108,7 +1108,7 @@ static llvm::Error genIndex(const ClangDocContext &CDCtx) {
llvm::SmallString<128> IndexPath;
llvm::sys::path::native(CDCtx.OutDirectory, IndexPath);
llvm::sys::path::append(IndexPath, "index.html");
llvm::raw_fd_ostream IndexOS(IndexPath, FileErr, llvm::sys::fs::OF_None);
llvm::raw_fd_ostream IndexOS(IndexPath, FileErr, llvm::sys::fs::OF_Text);
if (FileErr != OK) {
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"error creating main index: " +
Expand Down
6 changes: 3 additions & 3 deletions clang-tools-extra/clang-doc/MDGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static llvm::Error serializeIndex(ClangDocContext &CDCtx) {
llvm::SmallString<128> FilePath;
llvm::sys::path::native(CDCtx.OutDirectory, FilePath);
llvm::sys::path::append(FilePath, "all_files.md");
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_None);
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_Text);
if (FileErr)
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"error creating index file: " +
Expand All @@ -323,7 +323,7 @@ static llvm::Error genIndex(ClangDocContext &CDCtx) {
llvm::SmallString<128> FilePath;
llvm::sys::path::native(CDCtx.OutDirectory, FilePath);
llvm::sys::path::append(FilePath, "index.md");
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_None);
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_Text);
if (FileErr)
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"error creating index file: " +
Expand Down Expand Up @@ -407,7 +407,7 @@ MDGenerator::generateDocs(StringRef RootDir,
for (const auto &Group : FileToInfos) {
std::error_code FileErr;
llvm::raw_fd_ostream InfoOS(Group.getKey(), FileErr,
llvm::sys::fs::OF_None);
llvm::sys::fs::OF_Text);
if (FileErr) {
return llvm::createStringError(FileErr, "Error opening file '%s'",
Group.getKey().str().c_str());
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-doc/YAMLGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ YAMLGenerator::generateDocs(StringRef RootDir,
}

std::error_code FileErr;
llvm::raw_fd_ostream InfoOS(Path, FileErr, llvm::sys::fs::OF_None);
llvm::raw_fd_ostream InfoOS(Path, FileErr, llvm::sys::fs::OF_Text);
if (FileErr) {
return llvm::createStringError(FileErr, "Error opening file '%s'",
Path.c_str());
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ FuzzySymbolIndex::queryRegexp(const std::vector<std::string> &Tokens) {

llvm::Expected<std::unique_ptr<FuzzySymbolIndex>>
FuzzySymbolIndex::createFromYAML(StringRef FilePath) {
auto Buffer = llvm::MemoryBuffer::getFile(FilePath);
auto Buffer = llvm::MemoryBuffer::getFile(FilePath, /*IsText=*/true);
if (!Buffer)
return llvm::errorCodeToError(Buffer.getError());
return std::make_unique<MemSymbolIndex>(
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-include-fixer/YamlSymbolIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace include_fixer {

llvm::ErrorOr<std::unique_ptr<YamlSymbolIndex>>
YamlSymbolIndex::createFromFile(llvm::StringRef FilePath) {
auto Buffer = llvm::MemoryBuffer::getFile(FilePath);
auto Buffer = llvm::MemoryBuffer::getFile(FilePath, /*IsText=*/true);
if (!Buffer)
return Buffer.getError();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ bool Merge(llvm::StringRef MergeDir, llvm::StringRef OutputFile) {
// Parse YAML files in parallel.
Pool.async(
[&AddSymbols](std::string Path) {
auto Buffer = llvm::MemoryBuffer::getFile(Path);
auto Buffer = llvm::MemoryBuffer::getFile(Path, /*IsText=*/true);
if (!Buffer) {
llvm::errs() << "Can't open " << Path << "\n";
return;
Expand All @@ -114,7 +114,7 @@ bool Merge(llvm::StringRef MergeDir, llvm::StringRef OutputFile) {
}
}

llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_None);
llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_Text);
if (EC) {
llvm::errs() << "Can't open '" << OutputFile << "': " << EC.message()
<< '\n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ int includeFixerMain(int argc, const char **argv) {
llvm::errs() << llvm::toString(InsertStyle.takeError()) << "\n";
return 1;
}
auto Buffer = llvm::MemoryBuffer::getFile(FilePath);
auto Buffer = llvm::MemoryBuffer::getFile(FilePath, /*IsText=*/true);
if (!Buffer) {
errs() << "Couldn't open file: " + FilePath.str() + ": "
<< Buffer.getError().message() + "\n";
Expand Down