[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

Abhina Sree via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 10 13:03:01 PDT 2024


================
@@ -54,7 +54,9 @@ std::unique_ptr<HeaderMap> HeaderMap::Create(FileEntryRef FE, FileManager &FM) {
   unsigned FileSize = FE.getSize();
   if (FileSize <= sizeof(HMapHeader)) return nullptr;
 
-  auto FileBuffer = FM.getBufferForFile(FE);
+  auto FileBuffer =
+      FM.getBufferForFile(FE, /*IsVolatile=*/false,
+                          /*RequiresNullTerminator=*/true, /*IsText=*/false);
----------------
abhina-sree wrote:

So the following tests were previously failing on z/OS due to the binary/text issue and will be fixed by this change
clang/test/Preprocessor/headermap-rel.c
clang/test/Preprocessor/headermap-rel2.c

https://github.com/llvm/llvm-project/pull/111723


More information about the cfe-commits mailing list