mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 17:28:30 +08:00
Remove trailing return flag from FunctionTypeLoc, since we now carry that
information on FunctionProtoType. (This also fixes one of *many* misalignment problems in the TypeLoc hierarchy...) llvm-svn: 161901
This commit is contained in:
@@ -1061,7 +1061,6 @@ public:
|
||||
struct FunctionLocInfo {
|
||||
SourceLocation LocalRangeBegin;
|
||||
SourceLocation LocalRangeEnd;
|
||||
bool TrailingReturn;
|
||||
};
|
||||
|
||||
/// \brief Wrapper for source info for functions.
|
||||
@@ -1084,13 +1083,6 @@ public:
|
||||
getLocalData()->LocalRangeEnd = L;
|
||||
}
|
||||
|
||||
bool getTrailingReturn() const {
|
||||
return getLocalData()->TrailingReturn;
|
||||
}
|
||||
void setTrailingReturn(bool Trailing) {
|
||||
getLocalData()->TrailingReturn = Trailing;
|
||||
}
|
||||
|
||||
ArrayRef<ParmVarDecl *> getParams() const {
|
||||
return ArrayRef<ParmVarDecl *>(getParmArray(), getNumArgs());
|
||||
}
|
||||
@@ -1119,7 +1111,6 @@ public:
|
||||
void initializeLocal(ASTContext &Context, SourceLocation Loc) {
|
||||
setLocalRangeBegin(Loc);
|
||||
setLocalRangeEnd(Loc);
|
||||
setTrailingReturn(false);
|
||||
for (unsigned i = 0, e = getNumArgs(); i != e; ++i)
|
||||
setArg(i, NULL);
|
||||
}
|
||||
|
||||
@@ -3224,7 +3224,6 @@ namespace {
|
||||
assert(Chunk.Kind == DeclaratorChunk::Function);
|
||||
TL.setLocalRangeBegin(Chunk.Loc);
|
||||
TL.setLocalRangeEnd(Chunk.EndLoc);
|
||||
TL.setTrailingReturn(Chunk.Fun.hasTrailingReturnType());
|
||||
|
||||
const DeclaratorChunk::FunctionTypeInfo &FTI = Chunk.Fun;
|
||||
for (unsigned i = 0, e = TL.getNumArgs(), tpi = 0; i != e; ++i) {
|
||||
|
||||
@@ -4205,7 +4205,7 @@ TreeTransform<Derived>::TransformFunctionProtoType(TypeLocBuilder &TLB,
|
||||
|
||||
QualType ResultType;
|
||||
|
||||
if (TL.getTrailingReturn()) {
|
||||
if (T->hasTrailingReturn()) {
|
||||
if (getDerived().TransformFunctionTypeParams(TL.getBeginLoc(),
|
||||
TL.getParmArray(),
|
||||
TL.getNumArgs(),
|
||||
@@ -4262,7 +4262,6 @@ TreeTransform<Derived>::TransformFunctionProtoType(TypeLocBuilder &TLB,
|
||||
FunctionProtoTypeLoc NewTL = TLB.push<FunctionProtoTypeLoc>(Result);
|
||||
NewTL.setLocalRangeBegin(TL.getLocalRangeBegin());
|
||||
NewTL.setLocalRangeEnd(TL.getLocalRangeEnd());
|
||||
NewTL.setTrailingReturn(TL.getTrailingReturn());
|
||||
for (unsigned i = 0, e = NewTL.getNumArgs(); i != e; ++i)
|
||||
NewTL.setArg(i, ParamDecls[i]);
|
||||
|
||||
@@ -4286,7 +4285,6 @@ QualType TreeTransform<Derived>::TransformFunctionNoProtoType(
|
||||
FunctionNoProtoTypeLoc NewTL = TLB.push<FunctionNoProtoTypeLoc>(Result);
|
||||
NewTL.setLocalRangeBegin(TL.getLocalRangeBegin());
|
||||
NewTL.setLocalRangeEnd(TL.getLocalRangeEnd());
|
||||
NewTL.setTrailingReturn(false);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
@@ -4259,7 +4259,6 @@ void TypeLocReader::VisitExtVectorTypeLoc(ExtVectorTypeLoc TL) {
|
||||
void TypeLocReader::VisitFunctionTypeLoc(FunctionTypeLoc TL) {
|
||||
TL.setLocalRangeBegin(ReadSourceLocation(Record, Idx));
|
||||
TL.setLocalRangeEnd(ReadSourceLocation(Record, Idx));
|
||||
TL.setTrailingReturn(Record[Idx++]);
|
||||
for (unsigned i = 0, e = TL.getNumArgs(); i != e; ++i) {
|
||||
TL.setArg(i, ReadDeclAs<ParmVarDecl>(Record, Idx));
|
||||
}
|
||||
|
||||
@@ -486,7 +486,6 @@ void TypeLocWriter::VisitExtVectorTypeLoc(ExtVectorTypeLoc TL) {
|
||||
void TypeLocWriter::VisitFunctionTypeLoc(FunctionTypeLoc TL) {
|
||||
Writer.AddSourceLocation(TL.getLocalRangeBegin(), Record);
|
||||
Writer.AddSourceLocation(TL.getLocalRangeEnd(), Record);
|
||||
Record.push_back(TL.getTrailingReturn());
|
||||
for (unsigned i = 0, e = TL.getNumArgs(); i != e; ++i)
|
||||
Writer.AddDeclRef(TL.getArg(i), Record);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user