[clang-tools-extra] r244329 - Silence gcc 5.1 unused variable warnings using LLVM_ATTRIBUTE_UNUSED.

Yaron Keren via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 7 09:37:34 PDT 2015


Author: yrnkrn
Date: Fri Aug  7 11:37:34 2015
New Revision: 244329

URL: http://llvm.org/viewvc/llvm-project?rev=244329&view=rev
Log:
Silence gcc 5.1 unused variable warnings using LLVM_ATTRIBUTE_UNUSED.


Modified:
    clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp

Modified: clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp?rev=244329&r1=244328&r2=244329&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp Fri Aug  7 11:37:34 2015
@@ -336,19 +336,19 @@ static int clangTidyMain(int argc, const
 
 // This anchor is used to force the linker to link the LLVMModule.
 extern volatile int LLVMModuleAnchorSource;
-static int LLVMModuleAnchorDestination = LLVMModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED LLVMModuleAnchorDestination = LLVMModuleAnchorSource;
 
 // This anchor is used to force the linker to link the GoogleModule.
 extern volatile int GoogleModuleAnchorSource;
-static int GoogleModuleAnchorDestination = GoogleModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED GoogleModuleAnchorDestination = GoogleModuleAnchorSource;
 
 // This anchor is used to force the linker to link the MiscModule.
 extern volatile int MiscModuleAnchorSource;
-static int MiscModuleAnchorDestination = MiscModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED MiscModuleAnchorDestination = MiscModuleAnchorSource;
 
 // This anchor is used to force the linker to link the ReadabilityModule.
 extern volatile int ReadabilityModuleAnchorSource;
-static int ReadabilityModuleAnchorDestination = ReadabilityModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED ReadabilityModuleAnchorDestination = ReadabilityModuleAnchorSource;
 
 } // namespace tidy
 } // namespace clang




More information about the cfe-commits mailing list