[cfe-commits] r155756 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaExpr.cpp test/SemaCXX/type-traits.cpp

Benjamin Kramer benny.kra at googlemail.com
Sat Apr 28 06:33:59 PDT 2012


On 28.04.2012, at 15:15, Jordy Rose wrote:

> 
> On Apr 28, 2012, at 6:00, Benjamin Kramer wrote:
> 
>> Modified: cfe/trunk/lib/AST/Type.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=155756&r1=155755&r2=155756&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/AST/Type.cpp (original)
>> +++ cfe/trunk/lib/AST/Type.cpp Sat Apr 28 05:00:42 2012
>> @@ -895,6 +895,14 @@
>> }
>> 
>> bool QualType::isPODType(ASTContext &Context) const {
>> +  // C++11 has a more relaxed definition of POD.
>> +  if (Context.getLangOpts().CPlusPlus0x)
>> +    return isCXX11PODType(Context);
>> +
>> +  return isCXX98PODType(Context);
>> +}
>> +
> 
> This seems small enough to put in Type.h for inlining. Just a thought?

That would require pulling in ASTContext and LangOptions into the header, which I wanted to avoid.

The calls should be tail call optimized so the performance hit is really small.

- Ben
> 
> Jordy
> 





More information about the cfe-commits mailing list