From: Craig Topper Date: Sat, 28 Jun 2014 23:22:33 +0000 (+0000) Subject: Import MutableArrayRef into clang namespace. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a905545a533f4fd355c3b3768fb07f287ae1072;p=clang Import MutableArrayRef into clang namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211988 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index c77b2b60df..607ca4ec27 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -1000,7 +1000,7 @@ public: void print(raw_ostream &OS) const override; }; -typedef llvm::MutableArrayRef DeclContextLookupResult; +typedef MutableArrayRef DeclContextLookupResult; typedef ArrayRef DeclContextLookupConstResult; diff --git a/include/clang/AST/DeclOpenMP.h b/include/clang/AST/DeclOpenMP.h index 76282a3402..1b329dcd00 100644 --- a/include/clang/AST/DeclOpenMP.h +++ b/include/clang/AST/DeclOpenMP.h @@ -47,10 +47,10 @@ class OMPThreadPrivateDecl : public Decl { NumVars); } - llvm::MutableArrayRef getVars() { - return llvm::MutableArrayRef( - reinterpret_cast(this + 1), - NumVars); + MutableArrayRef getVars() { + return MutableArrayRef( + reinterpret_cast(this + 1), + NumVars); } void setVars(ArrayRef VL); @@ -62,7 +62,7 @@ public: static OMPThreadPrivateDecl *CreateDeserialized(ASTContext &C, unsigned ID, unsigned N); - typedef llvm::MutableArrayRef::iterator varlist_iterator; + typedef MutableArrayRef::iterator varlist_iterator; typedef ArrayRef::iterator varlist_const_iterator; typedef llvm::iterator_range varlist_range; typedef llvm::iterator_range varlist_const_range; diff --git a/include/clang/AST/OpenMPClause.h b/include/clang/AST/OpenMPClause.h index 0b1aaffcf3..95cb11ce64 100644 --- a/include/clang/AST/OpenMPClause.h +++ b/include/clang/AST/OpenMPClause.h @@ -76,8 +76,8 @@ template class OMPVarListClause : public OMPClause { protected: /// \brief Fetches list of variables associated with this clause. - llvm::MutableArrayRef getVarRefs() { - return llvm::MutableArrayRef( + MutableArrayRef getVarRefs() { + return MutableArrayRef( reinterpret_cast( reinterpret_cast(this) + llvm::RoundUpToAlignment(sizeof(T), llvm::alignOf())), @@ -108,7 +108,7 @@ protected: : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {} public: - typedef llvm::MutableArrayRef::iterator varlist_iterator; + typedef MutableArrayRef::iterator varlist_iterator; typedef ArrayRef::iterator varlist_const_iterator; typedef llvm::iterator_range varlist_range; typedef llvm::iterator_range varlist_const_range; diff --git a/include/clang/AST/StmtOpenMP.h b/include/clang/AST/StmtOpenMP.h index 59f24facb3..dfbc9a0bac 100644 --- a/include/clang/AST/StmtOpenMP.h +++ b/include/clang/AST/StmtOpenMP.h @@ -49,10 +49,10 @@ class OMPExecutableDirective : public Stmt { const unsigned ClausesOffset; /// \brief Get the clauses storage. - llvm::MutableArrayRef getClauses() { + MutableArrayRef getClauses() { OMPClause **ClauseStorage = reinterpret_cast( reinterpret_cast(this) + ClausesOffset); - return llvm::MutableArrayRef(ClauseStorage, NumClauses); + return MutableArrayRef(ClauseStorage, NumClauses); } protected: diff --git a/include/clang/AST/UnresolvedSet.h b/include/clang/AST/UnresolvedSet.h index 759af2537f..2ef5800c30 100644 --- a/include/clang/AST/UnresolvedSet.h +++ b/include/clang/AST/UnresolvedSet.h @@ -27,7 +27,7 @@ namespace clang { /// non-const iterator. class UnresolvedSetIterator { private: - typedef llvm::MutableArrayRef DeclsTy; + typedef MutableArrayRef DeclsTy; typedef DeclsTy::iterator IteratorTy; IteratorTy ir; diff --git a/include/clang/Basic/LLVM.h b/include/clang/Basic/LLVM.h index 940c19eea0..5a71fa85b3 100644 --- a/include/clang/Basic/LLVM.h +++ b/include/clang/Basic/LLVM.h @@ -29,6 +29,7 @@ namespace llvm { class StringRef; class Twine; template class ArrayRef; + template class MutableArrayRef; template class SmallString; template class SmallVector; template class SmallVectorImpl; @@ -62,6 +63,7 @@ namespace clang { using llvm::StringRef; using llvm::Twine; using llvm::ArrayRef; + using llvm::MutableArrayRef; using llvm::SmallString; using llvm::SmallVector; using llvm::SmallVectorImpl; diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 104d4b6712..94cb271117 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -264,7 +264,7 @@ public: typedef clang::TypeResult TypeResult; typedef Expr *ExprArg; - typedef llvm::MutableArrayRef MultiStmtArg; + typedef MutableArrayRef MultiStmtArg; typedef Sema::FullExprArg FullExprArg; ExprResult ExprError() { return ExprResult(true); } diff --git a/include/clang/Sema/Ownership.h b/include/clang/Sema/Ownership.h index c3b69bcabd..8031562e0e 100644 --- a/include/clang/Sema/Ownership.h +++ b/include/clang/Sema/Ownership.h @@ -258,11 +258,11 @@ namespace clang { typedef ActionResult DeclResult; typedef OpaquePtr ParsedTemplateTy; - typedef llvm::MutableArrayRef MultiExprArg; - typedef llvm::MutableArrayRef MultiStmtArg; - typedef llvm::MutableArrayRef ASTTemplateArgsPtr; - typedef llvm::MutableArrayRef MultiTypeArg; - typedef llvm::MutableArrayRef MultiTemplateParamsArg; + typedef MutableArrayRef MultiExprArg; + typedef MutableArrayRef MultiStmtArg; + typedef MutableArrayRef ASTTemplateArgsPtr; + typedef MutableArrayRef MultiTypeArg; + typedef MutableArrayRef MultiTemplateParamsArg; inline ExprResult ExprError() { return ExprResult(true); } inline StmtResult StmtError() { return StmtResult(true); } diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index ce3024ec04..ce958b9411 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -1150,7 +1150,7 @@ public: /// unqualified type will always be a FunctionProtoType. /// Otherwise, returns a NULL type. QualType BuildFunctionType(QualType T, - llvm::MutableArrayRef ParamTypes, + MutableArrayRef ParamTypes, SourceLocation Loc, DeclarationName Entity, const FunctionProtoType::ExtProtoInfo &EPI); @@ -1631,7 +1631,7 @@ public: void FinalizeDeclaration(Decl *D); DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS, ArrayRef Group); - DeclGroupPtrTy BuildDeclaratorGroup(llvm::MutableArrayRef Group, + DeclGroupPtrTy BuildDeclaratorGroup(MutableArrayRef Group, bool TypeMayContainAuto = true); /// Should be called on all declarations that might have attached diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 92a3033ade..1cb6ab5bd9 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -3422,8 +3422,8 @@ void CXXNameMangler::mangleSeqID(unsigned SeqID) { // is encoded in base-36, using digits and upper case letters. char Buffer[7]; // log(2**32) / log(36) ~= 7 - llvm::MutableArrayRef BufferRef(Buffer); - llvm::MutableArrayRef::reverse_iterator I = BufferRef.rbegin(); + MutableArrayRef BufferRef(Buffer); + MutableArrayRef::reverse_iterator I = BufferRef.rbegin(); for (; SeqID != 0; SeqID /= 36) { unsigned C = SeqID % 36; diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index 0daf736478..e6a6d09b48 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -598,8 +598,8 @@ void MicrosoftCXXNameMangler::mangleNumber(int64_t Number) { // in the range of ASCII characters 'A' to 'P'. // The number 0x123450 would be encoded as 'BCDEFA' char EncodedNumberBuffer[sizeof(uint64_t) * 2]; - llvm::MutableArrayRef BufferRef(EncodedNumberBuffer); - llvm::MutableArrayRef::reverse_iterator I = BufferRef.rbegin(); + MutableArrayRef BufferRef(EncodedNumberBuffer); + MutableArrayRef::reverse_iterator I = BufferRef.rbegin(); for (; Value != 0; Value >>= 4) *I++ = 'A' + (Value & 0xf); Out.write(I.base(), I - BufferRef.rbegin()); diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 073da57b36..ef2035c290 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -9277,7 +9277,7 @@ Sema::DeclGroupPtrTy Sema::FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS, /// BuildDeclaratorGroup - convert a list of declarations into a declaration /// group, performing any necessary semantic checking. Sema::DeclGroupPtrTy -Sema::BuildDeclaratorGroup(llvm::MutableArrayRef Group, +Sema::BuildDeclaratorGroup(MutableArrayRef Group, bool TypeMayContainAuto) { // C++0x [dcl.spec.auto]p7: // If the type deduced for the template parameter U is not the same in each diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index e513568ec3..4eed8c1467 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -10429,7 +10429,7 @@ static ExprResult BuildRecoveryCallExpr(Sema &SemaRef, Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE, SourceLocation LParenLoc, - llvm::MutableArrayRef Args, + MutableArrayRef Args, SourceLocation RParenLoc, bool EmptyLookup, bool AllowTypoCorrection) { // Do not try to recover if it is already building a recovery call. diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index d27e75aefa..dc1cddc59f 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -1934,7 +1934,7 @@ Sema::ActOnCXXForRangeStmt(SourceLocation ForLoc, // Claim the type doesn't contain auto: we've already done the checking. DeclGroupPtrTy RangeGroup = - BuildDeclaratorGroup(llvm::MutableArrayRef((Decl **)&RangeVar, 1), + BuildDeclaratorGroup(MutableArrayRef((Decl **)&RangeVar, 1), /*TypeMayContainAuto=*/ false); StmtResult RangeDecl = ActOnDeclStmt(RangeGroup, RangeLoc, RangeLoc); if (RangeDecl.isInvalid()) { @@ -2251,7 +2251,7 @@ Sema::BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation ColonLoc, Decl *BeginEndDecls[] = { BeginVar, EndVar }; // Claim the type doesn't contain auto: we've already done the checking. DeclGroupPtrTy BeginEndGroup = - BuildDeclaratorGroup(llvm::MutableArrayRef(BeginEndDecls, 2), + BuildDeclaratorGroup(MutableArrayRef(BeginEndDecls, 2), /*TypeMayContainAuto=*/ false); BeginEndDecl = ActOnDeclStmt(BeginEndGroup, ColonLoc, ColonLoc); diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index f7042927e4..99c61106b8 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -1763,7 +1763,7 @@ bool Sema::CheckFunctionReturnType(QualType T, SourceLocation Loc) { } QualType Sema::BuildFunctionType(QualType T, - llvm::MutableArrayRef ParamTypes, + MutableArrayRef ParamTypes, SourceLocation Loc, DeclarationName Entity, const FunctionProtoType::ExtProtoInfo &EPI) { bool Invalid = false; diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 175c4e6502..c48c4d04f5 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -750,7 +750,7 @@ public: /// By default, performs semantic analysis when building the function type. /// Subclasses may override this routine to provide different behavior. QualType RebuildFunctionProtoType(QualType T, - llvm::MutableArrayRef ParamTypes, + MutableArrayRef ParamTypes, const FunctionProtoType::ExtProtoInfo &EPI); /// \brief Build a new unprototyped function type. @@ -1201,7 +1201,7 @@ public: /// /// By default, performs semantic analysis to build the new statement. /// Subclasses may override this routine to provide different behavior. - StmtResult RebuildDeclStmt(llvm::MutableArrayRef Decls, + StmtResult RebuildDeclStmt(MutableArrayRef Decls, SourceLocation StartLoc, SourceLocation EndLoc) { Sema::DeclGroupPtrTy DG = getSema().BuildDeclaratorGroup(Decls); return getSema().ActOnDeclStmt(DG, StartLoc, EndLoc); @@ -9880,7 +9880,7 @@ TreeTransform::RebuildDependentSizedExtVectorType(QualType ElementType, template QualType TreeTransform::RebuildFunctionProtoType( QualType T, - llvm::MutableArrayRef ParamTypes, + MutableArrayRef ParamTypes, const FunctionProtoType::ExtProtoInfo &EPI) { return SemaRef.BuildFunctionType(T, ParamTypes, getDerived().getBaseLocation(),