<div dir="ltr">Not sure where the regression might've leaked in. But does seem to be something to do with anonymous namespace support and member functions: <a href="https://godbolt.org/z/zz8WP1">https://godbolt.org/z/zz8WP1</a><br><br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 1, 2021 at 5:12 PM Luke Benes via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
By building llvm-project with gcc 7 and 10, I found multiple Wunused-function warnings that clang 11/12 missed.<br>
<br>
All of these warnings were recently introduced, and the authors fixed many of them.   Any ideas why clang misses so many of this category? And why the ones missed are recent changes to the llvm codebase? <br>
<br>
-Luke<br>
<br>
<br>
==========<br>
<br>
 After dab953c8e44a2 with gcc 10.2.1, I see the following new warnings:<br>
<br>
[ 65%] Building CXX object lib/Linker/CMakeFiles/LLVMLinker.dir/IRMover.cpp.o<br>
/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:1600:1: warning: ‘std::pair<llvm::Value*, llvm::Value*> {anonymous}::DataFlowSanitizer::getShadowOriginAddress(llvm::Value*, llvm::Align, llvm::Instruction*)’ defined but not used [-Wunused-function]<br>
 1600 | DataFlowSanitizer::getShadowOriginAddress(Value *Addr, Align InstAlignment,<br>
      | ^~~~~~~~~~~~~~~~~<br>
/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:1510:6: warning: ‘void {anonymous}::DFSanFunction::setOrigin(llvm::Instruction*, llvm::Value*)’ defined but not used [-Wunused-function]<br>
 1510 | void DFSanFunction::setOrigin(Instruction *I, Value *Origin) {<br>
      |      ^~~~~~~~~~~~~<br>
/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:1476:8: warning: ‘llvm::Value* {anonymous}::DFSanFunction::getOrigin(llvm::Value*)’ defined but not used [-Wunused-function]<br>
 1476 | Value *DFSanFunction::getOrigin(Value *V) {<br>
      |        ^~~~~~~~~~~~~<br>
/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:1469:8: warning: ‘llvm::Value* {anonymous}::DFSanFunction::getRetvalOriginTLS()’ defined but not used [-Wunused-function]<br>
 1469 | Value *DFSanFunction::getRetvalOriginTLS() { return DFS.RetvalOriginTLS; }<br>
      |        ^~~~~~~~~~~~~<br>
<br>
FIX: <a href="https://github.com/llvm/llvm-project/commit/9524632fa2bf8c894e4aac27f03631a1915d84d3" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/9524632fa2bf8c894e4aac27f03631a1915d84d3</a><br>
<br>
==========<br>
<br>
After bc8e262afe83, with gcc 10.1 but not clang 11, I'm seeing:<br>
<br>
[ 21%] Building CXX object lib/MC/MCParser/CMakeFiles/LLVMMCParser.dir/MasmParser.cpp.o<br>
/llvm/lib/MC/MCParser/MasmParser.cpp:3836:6: warning: ‘bool {anonymous}::MasmParser::emitStructValue(const {anonymous}::StructInfo&)’ defined but not used [-Wunused-function]<br>
 3836 | bool MasmParser::emitStructValue(const StructInfo &Structure) {<br>
      |      ^~~~~~~~~~<br>
<br>
FIX: <a href="https://reviews.llvm.org/D83898" rel="noreferrer" target="_blank">https://reviews.llvm.org/D83898</a><br>
<br>
==========<br>
<br>
In 931a68f26b9a3, I'm seeing the following warning with gcc7 and gcc10:<br>
[ 70%] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/RegAllocPBQP.cpp.o<br>
/llvm/lib/CodeGen/RegAllocFast.cpp:384:6: warning: ‘bool {anonymous}::RegAllocFast::verifyRegStateMapping(const {anonymous}::RegAllocFast::LiveReg&) const’ defined but not used [-Wunused-function]<br>
 bool RegAllocFast::verifyRegStateMapping(const LiveReg &LR) const {<br>
      ^~~~~~~~~~~~<br>
<br>
FIX: 0671a4c5087d40450603d9d26cf239f1a8b1367e<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>