Skip to content

Commit 1d51546

Browse files
authored
[SystemZ][z/OS] Open YAML files for read as text files (#121340)
This patch makes sure YAML files are opened for reading as text file to trigger auto-conversion from EBCDIC encoding into expected ASCII encoding on z/OS platform. This is required to fix the following lit tests: ``` LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-exe.yaml LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-obj.test LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-dsym.yaml LLVM :: Transforms/PGOProfile/memprof_undrift_missing_leaf.ll ```
1 parent 80ecbaa commit 1d51546

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionYAML)
151151

152152
Error CallSiteInfoLoader::loadYAML(StringRef YAMLFile) {
153153
// Step 1: Read YAML file
154-
auto BufferOrError = MemoryBuffer::getFile(YAMLFile);
154+
auto BufferOrError = MemoryBuffer::getFile(YAMLFile, /*IsText=*/true);
155155
if (!BufferOrError)
156156
return errorCodeToError(BufferOrError.getError());
157157

llvm/lib/ProfileData/MemProfReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ Error RawMemProfReader::readNextRecord(
754754

755755
Expected<std::unique_ptr<YAMLMemProfReader>>
756756
YAMLMemProfReader::create(const Twine &Path) {
757-
auto BufferOr = MemoryBuffer::getFileOrSTDIN(Path);
757+
auto BufferOr = MemoryBuffer::getFileOrSTDIN(Path, /*IsText=*/true);
758758
if (std::error_code EC = BufferOr.getError())
759759
return report(errorCodeToError(EC), Path.getSingleStringRef());
760760

@@ -770,7 +770,7 @@ YAMLMemProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) {
770770
}
771771

772772
bool YAMLMemProfReader::hasFormat(const StringRef Path) {
773-
auto BufferOr = MemoryBuffer::getFileOrSTDIN(Path);
773+
auto BufferOr = MemoryBuffer::getFileOrSTDIN(Path, /*IsText=*/true);
774774
if (!BufferOr)
775775
return false;
776776

0 commit comments

Comments
 (0)