r225960 - Sema: It's cheaper to ask LookupResult::empty than to calculate linkage

David Majnemer david.majnemer at gmail.com
Wed Jan 14 00:08:52 PST 2015


Author: majnemer
Date: Wed Jan 14 02:08:52 2015
New Revision: 225960

URL: http://llvm.org/viewvc/llvm-project?rev=225960&view=rev
Log:
Sema: It's cheaper to ask LookupResult::empty than to calculate linkage

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=225960&r1=225959&r2=225960&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Jan 14 02:08:52 2015
@@ -8059,7 +8059,7 @@ bool Sema::CheckFunctionDeclaration(Scop
     // the function returns a UDT (class, struct, or union type) that is not C
     // compatible, and if it does, warn the user.
     // But, issue any diagnostic on the first declaration only.
-    if (NewFD->isExternC() && Previous.empty()) {
+    if (Previous.empty() && NewFD->isExternC()) {
       QualType R = NewFD->getReturnType();
       if (R->isIncompleteType() && !R->isVoidType())
         Diag(NewFD->getLocation(), diag::warn_return_value_udt_incomplete)





More information about the cfe-commits mailing list