Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79584 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 060b4f4..153d5ab 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1509,9 +1509,10 @@
if (RecordDecl *OwningClass = dyn_cast<RecordDecl>(Owner)) {
Anon = FieldDecl::Create(Context, OwningClass, Record->getLocation(),
/*IdentifierInfo=*/0,
- Context.getTypeDeclType(Record), /*DInfo=*/0,
- /*BitWidth=*/0, /*Mutable=*/false,
- DS.getSourceRange().getBegin());
+ Context.getTypeDeclType(Record),
+ // FIXME: Type source info.
+ /*DInfo=*/0,
+ /*BitWidth=*/0, /*Mutable=*/false);
Anon->setAccess(AS_public);
if (getLangOptions().CPlusPlus)
FieldCollector->Add(cast<FieldDecl>(Anon));
@@ -1536,8 +1537,10 @@
Anon = VarDecl::Create(Context, Owner, Record->getLocation(),
/*IdentifierInfo=*/0,
- Context.getTypeDeclType(Record), /*DInfo=*/0,
- SC, DS.getSourceRange().getBegin());
+ Context.getTypeDeclType(Record),
+ // FIXME: Type source info.
+ /*DInfo=*/0,
+ SC);
}
Anon->setImplicit();
@@ -2151,9 +2154,7 @@
}
NewVD = VarDecl::Create(Context, DC, D.getIdentifierLoc(),
- II, R, DInfo, SC,
- // FIXME: Move to DeclGroup...
- D.getDeclSpec().getSourceRange().getBegin());
+ II, R, DInfo, SC);
if (D.isInvalidType())
NewVD->setInvalidDecl();
@@ -2459,9 +2460,7 @@
// code path.
NewFD = FunctionDecl::Create(Context, DC, D.getIdentifierLoc(),
Name, R, DInfo, SC, isInline,
- /*hasPrototype=*/true,
- // FIXME: Move to DeclGroup...
- D.getDeclSpec().getSourceRange().getBegin());
+ /*hasPrototype=*/true);
D.setInvalidType();
}
} else if (D.getKind() == Declarator::DK_Conversion) {
@@ -2510,9 +2509,7 @@
NewFD = FunctionDecl::Create(Context, DC,
D.getIdentifierLoc(),
- Name, R, DInfo, SC, isInline, HasPrototype,
- // FIXME: Move to DeclGroup...
- D.getDeclSpec().getSourceRange().getBegin());
+ Name, R, DInfo, SC, isInline, HasPrototype);
}
if (D.isInvalidType())
@@ -4546,7 +4543,7 @@
}
FieldDecl *NewFD = FieldDecl::Create(Context, Record, Loc, II, T, DInfo,
- BitWidth, Mutable, TSSL);
+ BitWidth, Mutable);
if (InvalidDecl)
NewFD->setInvalidDecl();
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 2edfea1..15d32b0 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -3279,8 +3279,7 @@
// FIXME: Need to check for abstract classes.
VarDecl *ExDecl = VarDecl::Create(Context, CurContext, Loc,
- Name, ExDeclType, DInfo, VarDecl::None,
- Range.getBegin());
+ Name, ExDeclType, DInfo, VarDecl::None);
if (Invalid)
ExDecl->setInvalidDecl();
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 7c3f7ec..7540dff 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -676,8 +676,7 @@
QualType FnType = Context.getFunctionType(Return, &Argument, 1, false, 0);
FunctionDecl *Alloc =
FunctionDecl::Create(Context, GlobalCtx, SourceLocation(), Name,
- FnType, /*DInfo=*/0, FunctionDecl::None, false, true,
- SourceLocation());
+ FnType, /*DInfo=*/0, FunctionDecl::None, false, true);
Alloc->setImplicit();
ParmVarDecl *Param = ParmVarDecl::Create(Context, Alloc, SourceLocation(),
0, Argument, /*DInfo=*/0,
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 8d75ac4..078c32b 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -125,7 +125,7 @@
VarDecl *Var = VarDecl::Create(SemaRef.Context, Owner,
D->getLocation(), D->getIdentifier(),
T, D->getDeclaratorInfo(),
- D->getStorageClass(),D->getTypeSpecStartLoc());
+ D->getStorageClass());
Var->setThreadSpecified(D->isThreadSpecified());
Var->setCXXDirectInitializer(D->hasCXXDirectInitializer());
Var->setDeclaredInCondition(D->isDeclaredInCondition());
@@ -416,8 +416,7 @@
FunctionDecl::Create(SemaRef.Context, Owner, D->getLocation(),
D->getDeclName(), T, D->getDeclaratorInfo(),
D->getStorageClass(),
- D->isInline(), D->hasWrittenPrototype(),
- D->getTypeSpecStartLoc());
+ D->isInline(), D->hasWrittenPrototype());
}
// Attach the parameters