[all-commits] [llvm/llvm-project] e970d2: [llvm-mt] Add support /notify_update

Alex Brachet via All-commits all-commits at lists.llvm.org
Thu Mar 10 19:48:08 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e970d2823cf2a666cb597bf06ff8e0d0b880d361
      https://github.com/llvm/llvm-project/commit/e970d2823cf2a666cb597bf06ff8e0d0b880d361
  Author: Alex Brachet <abrachet at google.com>
  Date:   2022-03-11 (Fri, 11 Mar 2022)

  Changed paths:
    A llvm/test/tools/llvm-mt/notify_update.test
    M llvm/tools/llvm-mt/Opts.td
    M llvm/tools/llvm-mt/llvm-mt.cpp

  Log Message:
  -----------
  [llvm-mt] Add support /notify_update

`/notify_update` is an undocumented feature used by CMake. From their usage, it looks like this feature just changes `mt`'s exit code if the output file was changed. See https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmcmd.cxx#L2300 this is also consistent with some testing I have done of the mt.exeshipped with Visual Studio. See also the comment at https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmcmd.cxx#L2440.

There might be a more performant way to implement this by first checking calling `llvm::sys::fs::file_size()` and if it is the same as the new output's size use `llvm::WritableMemoryBuffer` and fallback to `llvm::FileOutputBuffer` otherwise,  but these don't inherit from a common ancestor so any implementation doing this would be really ugly.

Fixes https://github.com/llvm/llvm-project/issues/54329

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D121438




More information about the All-commits mailing list