Build problem with `clang-format`

My change (D143602) fails to build in the CI system with the following error:

CMake Error at cmake/modules/AddLLVM.cmake:588 (add_library):
  Cannot find source file:
 
    AsmPrinter.cpp
 
  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:848 (llvm_add_library)
  cmake/modules/AddLLVM.cmake:823 (add_llvm_library)
  lib/CodeGen/AsmPrinter/CMakeLists.txt:1 (add_llvm_component_library)
 
CMake Error at cmake/modules/AddLLVM.cmake:588 (add_library):
  No SOURCES given to target: LLVMAsmPrinter
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:848 (llvm_add_library)
  cmake/modules/AddLLVM.cmake:823 (add_llvm_library)
  lib/CodeGen/AsmPrinter/CMakeLists.txt:1 (add_llvm_component_library)
 
CMake Generate step failed.  Build files cannot be regenerated correctly.
 clang-format
changed files:
    lib/CodeGen/AsmPrinter/AsmPrinter.cpp

I was not able to get a diff using git-clang-format locally (it seemed to say that everything was OK) until I ran the “Reproduce build locally” steps. These steps reported that the entire AsmPrinter.cpp file is in fact not correctly formatted (even without my changes). Do I need to do a NFC change to fix the formatting of this file before I can submit a change to it? And, does the clang-format problem explain the “Cannot find source file” error? It seems a bit confusing if so.

Your revision uses a diff that doesn’t include llvm/ in the paths, instead putting lib/ and test/ in the monorepo root.

Ah! Because I have git diff configured with no-prefix I guess… I’ll try fixing that and see what happens. Thanks! (Update: that was indeed the problem!)