diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 16 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 2 |
2 files changed, 2 insertions, 16 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index f0a0e67f92..d0411c035a 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -771,17 +771,6 @@ Scope *Sema::getNonFieldDeclScope(Scope *S) { 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 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned bid, 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 @@ Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC, 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; diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index c22b5e5bb6..ef21a2719b 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -7437,8 +7437,6 @@ ExprResult Sema::BuildVAArgExpr(SourceLocation BuiltinLoc, SourceLocation RPLoc) { Expr *OrigExpr = E; - InitBuiltinVaListType(); - // Get the va_list type QualType VaListType = Context.getBuiltinVaListType(); if (VaListType->isArrayType()) { |