[clang] a821999 - [clang][APINotes] Fix -Wunused-function warning (NFC)
Yang Fan via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 31 18:53:14 PDT 2021
Author: Yang Fan
Date: 2021-04-01T09:52:43+08:00
New Revision: a8219991d0245db8f31a923ba7f24e6beda345b0
URL: https://github.com/llvm/llvm-project/commit/a8219991d0245db8f31a923ba7f24e6beda345b0
DIFF: https://github.com/llvm/llvm-project/commit/a8219991d0245db8f31a923ba7f24e6beda345b0.diff
LOG: [clang][APINotes] Fix -Wunused-function warning (NFC)
GCC warning:
```
/llvm-project/clang/lib/APINotes/APINotesYAMLCompiler.cpp:574:23: warning: ‘void {anonymous}::Module::dump()’ defined but not used [-Wunused-function]
574 | LLVM_DUMP_METHOD void Module::dump() {
| ^~~~~~
```
Added:
Modified:
clang/lib/APINotes/APINotesYAMLCompiler.cpp
Removed:
################################################################################
diff --git a/clang/lib/APINotes/APINotesYAMLCompiler.cpp b/clang/lib/APINotes/APINotesYAMLCompiler.cpp
index cf50e26b1c87a..75100fde59b84 100644
--- a/clang/lib/APINotes/APINotesYAMLCompiler.cpp
+++ b/clang/lib/APINotes/APINotesYAMLCompiler.cpp
@@ -551,7 +551,9 @@ struct Module {
llvm::Optional<bool> SwiftInferImportAsMember = {llvm::None};
- void dump() /*const*/;
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+ LLVM_DUMP_METHOD void dump() /*const*/;
+#endif
};
} // namespace
@@ -571,10 +573,12 @@ template <> struct MappingTraits<Module> {
} // namespace yaml
} // namespace llvm
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void Module::dump() {
llvm::yaml::Output OS(llvm::errs());
OS << *this;
}
+#endif
namespace {
bool parseAPINotes(StringRef YI, Module &M, llvm::SourceMgr::DiagHandlerTy Diag,
More information about the cfe-commits
mailing list