[cfe-commits] r168016 - in /cfe/trunk: lib/AST/ASTContext.cpp test/Sema/ppc-bool.c

Hal Finkel hfinkel at anl.gov
Wed Nov 14 17:27:36 PST 2012


----- Original Message -----
> From: "Eli Friedman" <eli.friedman at gmail.com>
> To: cfe-commits at cs.uiuc.edu
> Sent: Wednesday, November 14, 2012 7:21:59 PM
> Subject: [cfe-commits] r168016 - in /cfe/trunk: lib/AST/ASTContext.cpp	test/Sema/ppc-bool.c
> 
> Author: efriedma
> Date: Wed Nov 14 19:21:59 2012
> New Revision: 168016
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=168016&view=rev
> Log:
> Fix a trivial bool-related bug I spotted while skimming David Fang's
> current list of powerpc-darwin8 failures.
> 
> 
> Added:
>     cfe/trunk/test/Sema/ppc-bool.c
> Modified:
>     cfe/trunk/lib/AST/ASTContext.cpp
> 
> Modified: cfe/trunk/lib/AST/ASTContext.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=168016&r1=168015&r2=168016&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/ASTContext.cpp (original)
> +++ cfe/trunk/lib/AST/ASTContext.cpp Wed Nov 14 19:21:59 2012
> @@ -4153,8 +4153,8 @@
>    // At this point, we should have a signed or unsigned integer
>    type.
>    if (Promotable->isSignedIntegerType())
>      return IntTy;
> -  uint64_t PromotableSize = getTypeSize(Promotable);
> -  uint64_t IntSize = getTypeSize(IntTy);
> +  uint64_t PromotableSize = getIntWidth(Promotable);
> +  uint64_t IntSize = getIntWidth(IntTy);

Should we rename the variables too?

 -Hal

>    assert(Promotable->isUnsignedIntegerType() && PromotableSize <=
>    IntSize);
>    return (PromotableSize != IntSize) ? IntTy : UnsignedIntTy;
>  }
> 
> Added: cfe/trunk/test/Sema/ppc-bool.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/ppc-bool.c?rev=168016&view=auto
> ==============================================================================
> --- cfe/trunk/test/Sema/ppc-bool.c (added)
> +++ cfe/trunk/test/Sema/ppc-bool.c Wed Nov 14 19:21:59 2012
> @@ -0,0 +1,4 @@
> +// RUN: %clang_cc1 -triple powerpc-apple-macosx10.4.0 -verify
> -fsyntax-only %s
> +// expected-no-diagnostics
> +extern __typeof(+(_Bool)0) should_be_int;
> +extern int should_be_int;
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-commits mailing list