[PATCH] D139052: [NFC][Profile] Access profile through VirtualFileSystem

Ben Langmuir via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 16:11:56 PST 2022


benlangmuir added inline comments.


================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:194
       : Diags(_Diags), HSOpts(HeaderSearchOpts), CodeGenOpts(CGOpts),
-        TargetOpts(TOpts), LangOpts(LOpts), TheModule(M),
+        TargetOpts(TOpts), LangOpts(LOpts), TheModule(M), VFS(VFS),
         CodeGenerationTime("codegen", "Code Generation Time"),
----------------
Nit: `std::move(VFS)` to reduce refcounting.


================
Comment at: clang/lib/CodeGen/CodeGenAction.cpp:164
           LLVMIRGenerationRefCount(0),
-          Gen(CreateLLVMCodeGen(Diags, InFile, std::move(FS), HeaderSearchOpts,
-                                PPOpts, CodeGenOpts, C, CoverageInfo)),
+          Gen(CreateLLVMCodeGen(Diags, InFile, FS, HeaderSearchOpts, PPOpts,
+                                CodeGenOpts, C, CoverageInfo)),
----------------
Wouldn't `move` be fine here since it's already copied to `this->FS`?


================
Comment at: llvm/lib/ProfileData/SampleProfReader.cpp:1838
+                                           : FS.getBufferForFile(Filename);
+  // auto BufferOrErr = MemoryBuffer::getFileOrSTDIN(Filename, /*IsText=*/true);
   if (std::error_code EC = BufferOrErr.getError())
----------------
Commented out code


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:466
+      : SampleProfileLoaderBaseImpl(std::string(Name), std::string(RemapName),
+                                    FS),
         GetAC(std::move(GetAssumptionCache)),
----------------
move?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139052/new/

https://reviews.llvm.org/D139052



More information about the llvm-commits mailing list