<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 24, 2015 at 4:36 PM, Craig Topper via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ctopper<br>
Date: Thu Dec 24 18:36:02 2015<br>
New Revision: 256403<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=256403&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=256403&view=rev</a><br>
Log:<br>
Revert r256399 "[Sema] ArrayRef-ize ActOnBaseSpecifiers. NFC"<br>
<br>
It broke lldb build.<br></blockquote><div><br></div><div>Any idea why?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
cfe/trunk/include/clang/AST/DeclCXX.h<br>
cfe/trunk/include/clang/Sema/Sema.h<br>
cfe/trunk/lib/AST/ASTImporter.cpp<br>
cfe/trunk/lib/AST/DeclCXX.cpp<br>
cfe/trunk/lib/Parse/ParseDeclCXX.cpp<br>
cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/DeclCXX.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=256403&r1=256402&r2=256403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=256403&r1=256402&r2=256403&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)<br>
+++ cfe/trunk/include/clang/AST/DeclCXX.h Thu Dec 24 18:36:02 2015<br>
@@ -701,7 +701,7 @@ public:<br>
}<br>
<br>
/// \brief Sets the base classes of this struct or class.<br>
- void setBases(ArrayRef<const CXXBaseSpecifier *> Bases);<br>
+ void setBases(CXXBaseSpecifier const * const *Bases, unsigned NumBases);<br>
<br>
/// \brief Retrieves the number of base classes of this class.<br>
unsigned getNumBases() const { return data().NumBases; }<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Sema.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=256403&r1=256402&r2=256403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=256403&r1=256402&r2=256403&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Sema.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Sema.h Thu Dec 24 18:36:02 2015<br>
@@ -5365,10 +5365,10 @@ public:<br>
SourceLocation BaseLoc,<br>
SourceLocation EllipsisLoc);<br>
<br>
- bool AttachBaseSpecifiers(CXXRecordDecl *Class,<br>
- MutableArrayRef<CXXBaseSpecifier *> Bases);<br>
- void ActOnBaseSpecifiers(Decl *ClassDecl,<br>
- MutableArrayRef<CXXBaseSpecifier *> Bases);<br>
+ bool AttachBaseSpecifiers(CXXRecordDecl *Class, CXXBaseSpecifier **Bases,<br>
+ unsigned NumBases);<br>
+ void ActOnBaseSpecifiers(Decl *ClassDecl, CXXBaseSpecifier **Bases,<br>
+ unsigned NumBases);<br>
<br>
bool IsDerivedFrom(SourceLocation Loc, QualType Derived, QualType Base);<br>
bool IsDerivedFrom(SourceLocation Loc, QualType Derived, QualType Base,<br>
<br>
Modified: cfe/trunk/lib/AST/ASTImporter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=256403&r1=256402&r2=256403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=256403&r1=256402&r2=256403&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTImporter.cpp Thu Dec 24 18:36:02 2015<br>
@@ -2073,7 +2073,7 @@ bool ASTNodeImporter::ImportDefinition(R<br>
EllipsisLoc));<br>
}<br>
if (!Bases.empty())<br>
- ToCXX->setBases(Bases);<br>
+ ToCXX->setBases(Bases.data(), Bases.size());<br>
}<br>
<br>
if (shouldForceImportDeclContext(Kind))<br>
<br>
Modified: cfe/trunk/lib/AST/DeclCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=256403&r1=256402&r2=256403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=256403&r1=256402&r2=256403&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)<br>
+++ cfe/trunk/lib/AST/DeclCXX.cpp Thu Dec 24 18:36:02 2015<br>
@@ -135,13 +135,14 @@ CXXRecordDecl::CreateDeserialized(const<br>
}<br>
<br>
void<br>
-CXXRecordDecl::setBases(ArrayRef<const CXXBaseSpecifier *> Bases) {<br>
+CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,<br>
+ unsigned NumBases) {<br>
ASTContext &C = getASTContext();<br>
<br>
if (!data().Bases.isOffset() && data().NumBases > 0)<br>
C.Deallocate(data().getBases());<br>
<br>
- if (!Bases.empty()) {<br>
+ if (NumBases) {<br>
// C++ [dcl.init.aggr]p1:<br>
// An aggregate is [...] a class with [...] no base classes [...].<br>
data().Aggregate = false;<br>
@@ -157,9 +158,9 @@ CXXRecordDecl::setBases(ArrayRef<const C<br>
// The virtual bases of this class.<br>
SmallVector<const CXXBaseSpecifier *, 8> VBases;<br>
<br>
- data().Bases = new(C) CXXBaseSpecifier [Bases.size()];<br>
- data().NumBases = Bases.size();<br>
- for (unsigned i = 0; i < Bases.size(); ++i) {<br>
+ data().Bases = new(C) CXXBaseSpecifier [NumBases];<br>
+ data().NumBases = NumBases;<br>
+ for (unsigned i = 0; i < NumBases; ++i) {<br>
data().getBases()[i] = *Bases[i];<br>
// Keep track of inherited vbases for this base class.<br>
const CXXBaseSpecifier *Base = Bases[i];<br>
<br>
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=256403&r1=256402&r2=256403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=256403&r1=256402&r2=256403&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)<br>
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Thu Dec 24 18:36:02 2015<br>
@@ -1844,7 +1844,7 @@ void Parser::ParseBaseClause(Decl *Class<br>
}<br>
<br>
// Attach the base specifiers<br>
- Actions.ActOnBaseSpecifiers(ClassDecl, BaseInfo);<br>
+ Actions.ActOnBaseSpecifiers(ClassDecl, BaseInfo.data(), BaseInfo.size());<br>
}<br>
<br>
/// ParseBaseSpecifier - Parse a C++ base-specifier. A base-specifier is<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=256403&r1=256402&r2=256403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=256403&r1=256402&r2=256403&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Dec 24 18:36:02 2015<br>
@@ -1553,9 +1553,9 @@ NoteIndirectBases(ASTContext &Context, I<br>
<br>
/// \brief Performs the actual work of attaching the given base class<br>
/// specifiers to a C++ class.<br>
-bool Sema::AttachBaseSpecifiers(CXXRecordDecl *Class,<br>
- MutableArrayRef<CXXBaseSpecifier *> Bases) {<br>
- if (Bases.empty())<br>
+bool Sema::AttachBaseSpecifiers(CXXRecordDecl *Class, CXXBaseSpecifier **Bases,<br>
+ unsigned NumBases) {<br>
+ if (NumBases == 0)<br>
return false;<br>
<br>
// Used to keep track of which base types we have already seen, so<br>
@@ -1571,7 +1571,7 @@ bool Sema::AttachBaseSpecifiers(CXXRecor<br>
// Copy non-redundant base specifiers into permanent storage.<br>
unsigned NumGoodBases = 0;<br>
bool Invalid = false;<br>
- for (unsigned idx = 0; idx < Bases.size(); ++idx) {<br>
+ for (unsigned idx = 0; idx < NumBases; ++idx) {<br>
QualType NewBaseType<br>
= Context.getCanonicalType(Bases[idx]->getType());<br>
NewBaseType = NewBaseType.getLocalUnqualifiedType();<br>
@@ -1597,7 +1597,7 @@ bool Sema::AttachBaseSpecifiers(CXXRecor<br>
Bases[NumGoodBases++] = Bases[idx];<br>
<br>
// Note this base's direct & indirect bases, if there could be ambiguity.<br>
- if (Bases.size() > 1)<br>
+ if (NumBases > 1)<br>
NoteIndirectBases(Context, IndirectBaseTypes, NewBaseType);<br>
<br>
if (const RecordType *Record = NewBaseType->getAs<RecordType>()) {<br>
@@ -1619,7 +1619,7 @@ bool Sema::AttachBaseSpecifiers(CXXRecor<br>
}<br>
<br>
// Attach the remaining base class specifiers to the derived class.<br>
- Class->setBases(Bases.slice(0, NumGoodBases));<br>
+ Class->setBases(Bases, NumGoodBases);<br>
<br>
for (unsigned idx = 0; idx < NumGoodBases; ++idx) {<br>
// Check whether this direct base is inaccessible due to ambiguity.<br>
@@ -1654,13 +1654,13 @@ bool Sema::AttachBaseSpecifiers(CXXRecor<br>
/// ActOnBaseSpecifiers - Attach the given base specifiers to the<br>
/// class, after checking whether there are any duplicate base<br>
/// classes.<br>
-void Sema::ActOnBaseSpecifiers(Decl *ClassDecl,<br>
- MutableArrayRef<CXXBaseSpecifier *> Bases) {<br>
- if (!ClassDecl || Bases.empty())<br>
+void Sema::ActOnBaseSpecifiers(Decl *ClassDecl, CXXBaseSpecifier **Bases,<br>
+ unsigned NumBases) {<br>
+ if (!ClassDecl || !Bases || !NumBases)<br>
return;<br>
<br>
AdjustDeclIfTemplate(ClassDecl);<br>
- AttachBaseSpecifiers(cast<CXXRecordDecl>(ClassDecl), Bases);<br>
+ AttachBaseSpecifiers(cast<CXXRecordDecl>(ClassDecl), Bases, NumBases);<br>
}<br>
<br>
/// \brief Determine whether the type \p Derived is a C++ class that is<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=256403&r1=256402&r2=256403&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=256403&r1=256402&r2=256403&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Thu Dec 24 18:36:02 2015<br>
@@ -1837,7 +1837,9 @@ Sema::SubstBaseSpecifiers(CXXRecordDecl<br>
Invalid = true;<br>
}<br>
<br>
- if (!Invalid && AttachBaseSpecifiers(Instantiation, InstantiatedBases))<br>
+ if (!Invalid &&<br>
+ AttachBaseSpecifiers(Instantiation, InstantiatedBases.data(),<br>
+ InstantiatedBases.size()))<br>
Invalid = true;<br>
<br>
return Invalid;<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>