[cfe-commits] r115621 - in /cfe/trunk: include/clang/Basic/Builtins.h include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaExpr.cpp

İsmail Dönmez ismail at namtrac.org
Tue Oct 5 09:04:44 PDT 2010


This most possibly fixed http://llvm.org/bugs/show_bug.cgi?id=8284 , thanx!

On Tue, Oct 5, 2010 at 6:41 PM, Douglas Gregor <dgregor at apple.com> wrote:

> Author: dgregor
> Date: Tue Oct  5 10:41:24 2010
> New Revision: 115621
>
> URL: http://llvm.org/viewvc/llvm-project?rev=115621&view=rev
> Log:
> Register the __builtin_va_list_type node when we parse it, rather than
> waiting until we think we need it: we didn't catch all of the places
> where we actually needed it, and we probably wouldn't ever. Fixes a
> C++ PCH crasher.
>
> Modified:
>    cfe/trunk/include/clang/Basic/Builtins.h
>    cfe/trunk/include/clang/Sema/Sema.h
>    cfe/trunk/lib/Sema/SemaDecl.cpp
>    cfe/trunk/lib/Sema/SemaExpr.cpp
>
> Modified: cfe/trunk/include/clang/Basic/Builtins.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.h?rev=115621&r1=115620&r2=115621&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/Builtins.h (original)
> +++ cfe/trunk/include/clang/Basic/Builtins.h Tue Oct  5 10:41:24 2010
> @@ -124,12 +124,6 @@
>   /// argument and whether this function as a va_list argument.
>   bool isScanfLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg);
>
> -  /// hasVAListUse - Return true of the specified builtin uses
> __builtin_va_list
> -  /// as an operand or return type.
> -  bool hasVAListUse(unsigned ID) const {
> -    return strpbrk(GetRecord(ID).Type, "Aa") != 0;
> -  }
> -
>   /// isConstWithoutErrno - Return true if this function has no side
>   /// effects and doesn't read memory, except for possibly errno. Such
>   /// functions can be const when the MathErrno lang option is
>
> Modified: cfe/trunk/include/clang/Sema/Sema.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=115621&r1=115620&r2=115621&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Sema/Sema.h (original)
> +++ cfe/trunk/include/clang/Sema/Sema.h Tue Oct  5 10:41:24 2010
> @@ -4253,8 +4253,6 @@
>   /// in the global scope.
>   bool CheckObjCDeclScope(Decl *D);
>
> -  void InitBuiltinVaListType();
> -
>   /// VerifyIntegerConstantExpression - verifies that an expression is an
> ICE,
>   /// and reports the appropriate diagnostics. Returns false on success.
>   /// Can optionally return the value of the expression.
>
> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=115621&r1=115620&r2=115621&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Oct  5 10:41:24 2010
> @@ -771,17 +771,6 @@
>   return S;
>  }
>
> -void Sema::InitBuiltinVaListType() {
> -  if (!Context.getBuiltinVaListType().isNull())
> -    return;
> -
> -  IdentifierInfo *VaIdent = &Context.Idents.get("__builtin_va_list");
> -  NamedDecl *VaDecl = LookupSingleName(TUScope, VaIdent, SourceLocation(),
> -                                       LookupOrdinaryName,
> ForRedeclaration);
> -  TypedefDecl *VaTypedef = cast<TypedefDecl>(VaDecl);
> -  Context.setBuiltinVaListType(Context.getTypedefType(VaTypedef));
> -}
> -
>  /// LazilyCreateBuiltin - The specified Builtin-ID was first used at
>  /// file scope.  lazily create a decl for it. ForRedeclaration is true
>  /// if we're creating this built-in in anticipation of redeclaring the
> @@ -791,9 +780,6 @@
>                                      SourceLocation Loc) {
>   Builtin::ID BID = (Builtin::ID)bid;
>
> -  if (Context.BuiltinInfo.hasVAListUse(BID))
> -    InitBuiltinVaListType();
> -
>   ASTContext::GetBuiltinTypeError Error;
>   QualType R = Context.GetBuiltinType(BID, Error);
>   switch (Error) {
> @@ -2627,6 +2613,8 @@
>         Context.setjmp_bufDecl(NewTD);
>       else if (II->isStr("sigjmp_buf"))
>         Context.setsigjmp_bufDecl(NewTD);
> +      else if (II->isStr("__builtin_va_list"))
> +        Context.setBuiltinVaListType(Context.getTypedefType(NewTD));
>     }
>
>   return NewTD;
>
> Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=115621&r1=115620&r2=115621&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Oct  5 10:41:24 2010
> @@ -7437,8 +7437,6 @@
>                                             SourceLocation RPLoc) {
>   Expr *OrigExpr = E;
>
> -  InitBuiltinVaListType();
> -
>   // Get the va_list type
>   QualType VaListType = Context.getBuiltinVaListType();
>   if (VaListType->isArrayType()) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101005/df21acfe/attachment.html>


More information about the cfe-commits mailing list