-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[SystemZ][z/OS] Continue marking text files with OF_Text #95111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-llvm-analysis Author: Abhina Sree (abhina-sree) ChangesText files should be opened with OF_Text to have the correct encoding. Full diff: https://github.com/llvm/llvm-project/pull/95111.diff 4 Files Affected:
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index c863936a51882..a9913773fd13e 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -1075,7 +1075,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
if (!ModuleSummaryDotFile.empty()) {
std::error_code EC;
- raw_fd_ostream OSDot(ModuleSummaryDotFile, EC, sys::fs::OpenFlags::OF_None);
+ raw_fd_ostream OSDot(ModuleSummaryDotFile, EC, sys::fs::OpenFlags::OF_Text);
if (EC)
report_fatal_error(Twine("Failed to open dot file ") +
ModuleSummaryDotFile + ": " + EC.message() + "\n");
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 76223e88ca1ac..84a69d9ff1a1f 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -143,7 +143,7 @@ Error Config::addSaveTemps(std::string OutputFileName, bool UseInputModulePath,
writeIndexToFile(Index, OS);
Path = OutputFileName + "index.dot";
- raw_fd_ostream OSDot(Path, EC, sys::fs::OpenFlags::OF_None);
+ raw_fd_ostream OSDot(Path, EC, sys::fs::OpenFlags::OF_Text);
if (EC)
reportOpenError(Path, EC.message());
Index.exportToDot(OSDot, GUIDPreservedSymbols);
diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp
index c7adc7668b9a1..429edabcc6558 100644
--- a/llvm/lib/Passes/StandardInstrumentations.cpp
+++ b/llvm/lib/Passes/StandardInstrumentations.cpp
@@ -838,7 +838,7 @@ static int prepareDumpIRFileDescriptor(const StringRef DumpIRFilename) {
}
int Result = 0;
EC = sys::fs::openFile(DumpIRFilename, Result, sys::fs::CD_OpenAlways,
- sys::fs::FA_Write, sys::fs::OF_None);
+ sys::fs::FA_Write, sys::fs::OF_Text);
if (EC)
report_fatal_error(Twine("Failed to open ") + DumpIRFilename +
" to support -ir-dump-directory: " + EC.message());
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index cb19bf2a4ae17..b4514b938c277 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -1463,7 +1463,7 @@ std::error_code llvm::EmitImportsFiles(
StringRef ModulePath, StringRef OutputFilename,
const std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex) {
std::error_code EC;
- raw_fd_ostream ImportsOS(OutputFilename, EC, sys::fs::OpenFlags::OF_None);
+ raw_fd_ostream ImportsOS(OutputFilename, EC, sys::fs::OpenFlags::OF_Text);
if (EC)
return EC;
for (const auto &ILI : ModuleToSummariesForIndex)
|
@llvm/pr-subscribers-lto Author: Abhina Sree (abhina-sree) ChangesText files should be opened with OF_Text to have the correct encoding. Full diff: https://github.com/llvm/llvm-project/pull/95111.diff 4 Files Affected:
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index c863936a51882..a9913773fd13e 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -1075,7 +1075,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
if (!ModuleSummaryDotFile.empty()) {
std::error_code EC;
- raw_fd_ostream OSDot(ModuleSummaryDotFile, EC, sys::fs::OpenFlags::OF_None);
+ raw_fd_ostream OSDot(ModuleSummaryDotFile, EC, sys::fs::OpenFlags::OF_Text);
if (EC)
report_fatal_error(Twine("Failed to open dot file ") +
ModuleSummaryDotFile + ": " + EC.message() + "\n");
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 76223e88ca1ac..84a69d9ff1a1f 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -143,7 +143,7 @@ Error Config::addSaveTemps(std::string OutputFileName, bool UseInputModulePath,
writeIndexToFile(Index, OS);
Path = OutputFileName + "index.dot";
- raw_fd_ostream OSDot(Path, EC, sys::fs::OpenFlags::OF_None);
+ raw_fd_ostream OSDot(Path, EC, sys::fs::OpenFlags::OF_Text);
if (EC)
reportOpenError(Path, EC.message());
Index.exportToDot(OSDot, GUIDPreservedSymbols);
diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp
index c7adc7668b9a1..429edabcc6558 100644
--- a/llvm/lib/Passes/StandardInstrumentations.cpp
+++ b/llvm/lib/Passes/StandardInstrumentations.cpp
@@ -838,7 +838,7 @@ static int prepareDumpIRFileDescriptor(const StringRef DumpIRFilename) {
}
int Result = 0;
EC = sys::fs::openFile(DumpIRFilename, Result, sys::fs::CD_OpenAlways,
- sys::fs::FA_Write, sys::fs::OF_None);
+ sys::fs::FA_Write, sys::fs::OF_Text);
if (EC)
report_fatal_error(Twine("Failed to open ") + DumpIRFilename +
" to support -ir-dump-directory: " + EC.message());
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index cb19bf2a4ae17..b4514b938c277 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -1463,7 +1463,7 @@ std::error_code llvm::EmitImportsFiles(
StringRef ModulePath, StringRef OutputFilename,
const std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex) {
std::error_code EC;
- raw_fd_ostream ImportsOS(OutputFilename, EC, sys::fs::OpenFlags::OF_None);
+ raw_fd_ostream ImportsOS(OutputFilename, EC, sys::fs::OpenFlags::OF_Text);
if (EC)
return EC;
for (const auto &ILI : ModuleToSummariesForIndex)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Text files should be opened with OF_Text to have the correct encoding.