r203277 - Replace OwningPtr::isValid() with conversion to bool.

Joerg Sonnenberger joerg at britannica.bec.de
Sat Mar 8 01:38:51 PST 2014


On Fri, Mar 07, 2014 at 07:51:07PM -0000, Ahmed Charles wrote:
> Modified: cfe/trunk/include/clang/Frontend/ASTUnit.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ASTUnit.h?rev=203277&r1=203276&r2=203277&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Frontend/ASTUnit.h (original)
> +++ cfe/trunk/include/clang/Frontend/ASTUnit.h Fri Mar  7 13:51:06 2014
> @@ -500,7 +500,7 @@ public:
>    void setASTContext(ASTContext *ctx) { Ctx = ctx; }
>    void setPreprocessor(Preprocessor *pp);
>  
> -  bool hasSema() const { return TheSema.isValid(); }
> +  bool hasSema() const { return (bool)TheSema; }
>    Sema &getSema() const { 
>      assert(TheSema && "ASTUnit does not have a Sema object!");
>      return *TheSema; 
> 

Is the old-style cast really the preferred form for LLVM?

Joerg



More information about the cfe-commits mailing list