]> granicus.if.org Git - clang/commitdiff
Fixed another regression introduced by r51113 caused by some refactoring
authorTed Kremenek <kremenek@apple.com>
Thu, 15 May 2008 22:24:49 +0000 (22:24 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 15 May 2008 22:24:49 +0000 (22:24 +0000)
in Sema::CheckFunctionCall:

  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html

The bug was that the logic from the helper methods used by CheckFunctionCall
were being inverted (a subtle bug).  This would cause the parser to discard
any valid AST nodes involving several builtins (see patch).

This removes the last regression failure I'm seeing in the test suite: Analysis-Apple/NoReturn.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51168 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaChecking.cpp

index bbf43113ee74816be1559ba67112461b64ff9689..4f996edf2fd9d09fbc262aff63b0ea4314d41f87 100644 (file)
@@ -40,13 +40,13 @@ Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall) {
   case Builtin::BI__builtin___CFStringMakeConstantString:
     assert(TheCall->getNumArgs() == 1 &&
            "Wrong # arguments to builtin CFStringMakeConstantString");
-    if (!CheckBuiltinCFStringArgument(TheCall->getArg(0))) {
+    if (CheckBuiltinCFStringArgument(TheCall->getArg(0))) {
       delete TheCall;
       return true;
     }
     return TheCall;
   case Builtin::BI__builtin_va_start:
-    if (!SemaBuiltinVAStart(TheCall)) {
+    if (SemaBuiltinVAStart(TheCall)) {
       delete TheCall;
       return true;
     }
@@ -57,7 +57,7 @@ Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall) {
   case Builtin::BI__builtin_islessequal:
   case Builtin::BI__builtin_islessgreater:
   case Builtin::BI__builtin_isunordered:
-    if (!SemaBuiltinUnorderedCompare(TheCall)) {
+    if (SemaBuiltinUnorderedCompare(TheCall)) {
       delete TheCall;
       return true;
     }