Switch over functiondecl. This makes it obvious that the ASTContext
argument to Create should be first, not last.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48397 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index 13d49b0..a4c1a78 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -166,8 +166,8 @@
InitBuiltinVaListType();
QualType R = Context.BuiltinInfo.GetBuiltinType(BID, Context);
- FunctionDecl *New = new FunctionDecl(SourceLocation(), II, R,
- FunctionDecl::Extern, false, 0);
+ FunctionDecl *New = FunctionDecl::Create(Context, SourceLocation(), II, R,
+ FunctionDecl::Extern, false, 0);
// Find translation-unit scope to insert this function into.
if (Scope *FnS = S->getFnParent())
@@ -753,9 +753,10 @@
case DeclSpec::SCS_private_extern: SC = FunctionDecl::PrivateExtern;break;
}
- FunctionDecl *NewFD = new FunctionDecl(D.getIdentifierLoc(), II, R, SC,
- D.getDeclSpec().isInlineSpecified(),
- LastDeclarator);
+ bool isInline = D.getDeclSpec().isInlineSpecified();
+ FunctionDecl *NewFD = FunctionDecl::Create(Context, D.getIdentifierLoc(),
+ II, R, SC, isInline,
+ LastDeclarator);
// Handle attributes.
HandleDeclAttributes(NewFD, D.getDeclSpec().getAttributes(),
D.getAttributes());