[all-commits] [llvm/llvm-project] 8c7c1f: Silence unused variable warning in NDEBUG builds

Benjamin Kramer via All-commits all-commits at lists.llvm.org
Thu Mar 23 06:42:21 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c7c1f11ffaacf762e612c65440fd2cbb58ee426
  Author: Benjamin Kramer <benny.kra at googlemail.com>
  Date:   2023-03-23 (Thu, 23 Mar 2023)

  Changed paths:
    M clang/lib/Lex/ModuleMap.cpp

  Log Message:
  Silence unused variable warning in NDEBUG builds

I usually would fold this into the assert, but the comment there
suggests side effects. NFC.

ModuleMap.cpp:938:9: error: unused variable 'MainFile' [-Werror,-Wunused-variable]
  auto *MainFile = SourceMgr.getFileEntryForID(SourceMgr.getMainFileID());

More information about the All-commits mailing list