forked from OSchip/llvm-project
Don't rely on the use of non-POD types within unions.
They aren't universally supported and we're not getting any benefit from using them. llvm-svn: 241564
This commit is contained in:
parent
89442bbb79
commit
0a8890ff45
|
@ -610,7 +610,10 @@ public:
|
||||||
class ObjCTypeParamList {
|
class ObjCTypeParamList {
|
||||||
union {
|
union {
|
||||||
/// Location of the left and right angle brackets.
|
/// Location of the left and right angle brackets.
|
||||||
SourceRange Brackets;
|
struct {
|
||||||
|
unsigned Begin;
|
||||||
|
unsigned End;
|
||||||
|
} Brackets;
|
||||||
|
|
||||||
// Used only for alignment.
|
// Used only for alignment.
|
||||||
ObjCTypeParamDecl *AlignmentHack;
|
ObjCTypeParamDecl *AlignmentHack;
|
||||||
|
@ -661,9 +664,15 @@ public:
|
||||||
return *(end() - 1);
|
return *(end() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
SourceLocation getLAngleLoc() const { return Brackets.getBegin(); }
|
SourceLocation getLAngleLoc() const {
|
||||||
SourceLocation getRAngleLoc() const { return Brackets.getEnd(); }
|
return SourceLocation::getFromRawEncoding(Brackets.Begin);
|
||||||
SourceRange getSourceRange() const { return Brackets; }
|
}
|
||||||
|
SourceLocation getRAngleLoc() const {
|
||||||
|
return SourceLocation::getFromRawEncoding(Brackets.End);
|
||||||
|
}
|
||||||
|
SourceRange getSourceRange() const {
|
||||||
|
return SourceRange(getLAngleLoc(), getRAngleLoc());
|
||||||
|
}
|
||||||
|
|
||||||
/// Gather the default set of type arguments to be substituted for
|
/// Gather the default set of type arguments to be substituted for
|
||||||
/// these type parameters when dealing with an unspecialized type.
|
/// these type parameters when dealing with an unspecialized type.
|
||||||
|
|
|
@ -1251,8 +1251,10 @@ SourceRange ObjCTypeParamDecl::getSourceRange() const {
|
||||||
ObjCTypeParamList::ObjCTypeParamList(SourceLocation lAngleLoc,
|
ObjCTypeParamList::ObjCTypeParamList(SourceLocation lAngleLoc,
|
||||||
ArrayRef<ObjCTypeParamDecl *> typeParams,
|
ArrayRef<ObjCTypeParamDecl *> typeParams,
|
||||||
SourceLocation rAngleLoc)
|
SourceLocation rAngleLoc)
|
||||||
: Brackets(lAngleLoc, rAngleLoc), NumParams(typeParams.size())
|
: NumParams(typeParams.size())
|
||||||
{
|
{
|
||||||
|
Brackets.Begin = lAngleLoc.getRawEncoding();
|
||||||
|
Brackets.End = rAngleLoc.getRawEncoding();
|
||||||
std::copy(typeParams.begin(), typeParams.end(), begin());
|
std::copy(typeParams.begin(), typeParams.end(), begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue