[cfe-commits] r168549 - in /cfe/trunk/lib: AST/DeclBase.cpp Sema/SemaDecl.cpp
NAKAMURA Takumi
geek4civic at gmail.com
Sat Nov 24 15:17:09 PST 2012
Author: chapuni
Date: Sat Nov 24 17:17:09 2012
New Revision: 168549
URL: http://llvm.org/viewvc/llvm-project?rev=168549&view=rev
Log:
Revert r168519, "Merge used flags so that we don't have to iterate on isUsed. With this change"
It brought bunch of (possibly false) warnings.
llvm/unittests/VMCore/PassManagerTest.cpp:60:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
char ModuleNDNM::ID=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:86:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
char ModuleNDM2::ID=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:106:21: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
char ModuleDNM::ID=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:217:16: warning: variable 'initcount' is not needed and will not be emitted [-Wunneeded-internal-declaration]
int LPass::initcount=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:218:16: warning: variable 'fincount' is not needed and will not be emitted [-Wunneeded-internal-declaration]
int LPass::fincount=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:259:16: warning: variable 'inited' is not needed and will not be emitted [-Wunneeded-internal-declaration]
int BPass::inited=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:260:16: warning: variable 'fin' is not needed and will not be emitted [-Wunneeded-internal-declaration]
int BPass::fin=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:283:24: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
char OnTheFlyTest::ID=0;
^
8 warnings generated.
Modified:
cfe/trunk/lib/AST/DeclBase.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=168549&r1=168548&r2=168549&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Sat Nov 24 17:17:09 2012
@@ -261,6 +261,13 @@
if (CheckUsedAttr && hasAttr<UsedAttr>())
return true;
+ // Check redeclarations. We merge attributes, so we don't need to check
+ // attributes in all redeclarations.
+ for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) {
+ if (I->Used)
+ return true;
+ }
+
return false;
}
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=168549&r1=168548&r2=168549&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sat Nov 24 17:17:09 2012
@@ -2388,10 +2388,6 @@
if (Old->isPure())
New->setPure();
- // Merge "used" flag.
- if (Old->isUsed(false))
- New->setUsed();
-
// Merge attributes from the parameters. These can mismatch with K&R
// declarations.
if (New->getNumParams() == Old->getNumParams())
More information about the cfe-commits
mailing list