Skip to content

Commit 2e43d4b

Browse files
committed
[NFC][Clang][AST] Drop llvm:: in front of ArrayRef
1 parent 056b52d commit 2e43d4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+238
-265
lines changed

clang/include/clang/AST/AbstractBasicReader.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ class DataStreamBasicReader : public BasicReaderBase<Impl> {
143143
// structure into a single data stream.
144144
Impl &readObject() { return asImpl(); }
145145

146-
template <class T>
147-
llvm::ArrayRef<T> readArray(llvm::SmallVectorImpl<T> &buffer) {
146+
template <class T> ArrayRef<T> readArray(llvm::SmallVectorImpl<T> &buffer) {
148147
assert(buffer.empty());
149148

150149
uint32_t size = asImpl().readUInt32();

clang/include/clang/AST/AbstractBasicWriter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ class DataStreamBasicWriter : public BasicWriterBase<Impl> {
138138
asImpl().writeUInt32(uint32_t(value));
139139
}
140140

141-
template <class T>
142-
void writeArray(llvm::ArrayRef<T> array) {
141+
template <class T> void writeArray(ArrayRef<T> array) {
143142
asImpl().writeUInt32(array.size());
144143
for (const T &elt : array) {
145144
WriteDispatcher<T>::write(asImpl(), elt);

clang/include/clang/AST/ComputeDependence.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include "clang/AST/DependenceFlags.h"
1717
#include "clang/Basic/ExceptionSpecificationType.h"
18-
#include "llvm/ADT/ArrayRef.h"
18+
#include "clang/Basic/LLVM.h"
1919

2020
namespace clang {
2121

@@ -180,7 +180,7 @@ ExprDependence computeDependence(ConceptSpecializationExpr *E,
180180

181181
ExprDependence computeDependence(SYCLUniqueStableNameExpr *E);
182182
ExprDependence computeDependence(PredefinedExpr *E);
183-
ExprDependence computeDependence(CallExpr *E, llvm::ArrayRef<Expr *> PreArgs);
183+
ExprDependence computeDependence(CallExpr *E, ArrayRef<Expr *> PreArgs);
184184
ExprDependence computeDependence(OffsetOfExpr *E);
185185
ExprDependence computeDependence(MemberExpr *E);
186186
ExprDependence computeDependence(ShuffleVectorExpr *E);

clang/include/clang/AST/Decl.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3417,16 +3417,13 @@ class IndirectFieldDecl : public ValueDecl,
34173417

34183418
static IndirectFieldDecl *Create(ASTContext &C, DeclContext *DC,
34193419
SourceLocation L, const IdentifierInfo *Id,
3420-
QualType T,
3421-
llvm::MutableArrayRef<NamedDecl *> CH);
3420+
QualType T, MutableArrayRef<NamedDecl *> CH);
34223421

34233422
static IndirectFieldDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);
34243423

34253424
using chain_iterator = ArrayRef<NamedDecl *>::const_iterator;
34263425

3427-
ArrayRef<NamedDecl *> chain() const {
3428-
return llvm::ArrayRef(Chaining, ChainingSize);
3429-
}
3426+
ArrayRef<NamedDecl *> chain() const { return {Chaining, ChainingSize}; }
34303427
chain_iterator chain_begin() const { return chain().begin(); }
34313428
chain_iterator chain_end() const { return chain().end(); }
34323429

clang/include/clang/AST/DeclCXX.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,10 @@ class CXXRecordDecl : public RecordDecl {
365365
return getVBasesSlowCase();
366366
}
367367

368-
ArrayRef<CXXBaseSpecifier> bases() const {
369-
return llvm::ArrayRef(getBases(), NumBases);
370-
}
368+
ArrayRef<CXXBaseSpecifier> bases() const { return {getBases(), NumBases}; }
371369

372370
ArrayRef<CXXBaseSpecifier> vbases() const {
373-
return llvm::ArrayRef(getVBases(), NumVBases);
371+
return {getVBases(), NumVBases};
374372
}
375373

376374
private:
@@ -4190,7 +4188,7 @@ class BindingDecl : public ValueDecl {
41904188
Expr *getBinding() const { return Binding; }
41914189

41924190
// Get the array of nested BindingDecls when the binding represents a pack.
4193-
llvm::ArrayRef<BindingDecl *> getBindingPackDecls() const;
4191+
ArrayRef<BindingDecl *> getBindingPackDecls() const;
41944192

41954193
/// Get the decomposition declaration that this binding represents a
41964194
/// decomposition of.
@@ -4269,11 +4267,11 @@ class DecompositionDecl final
42694267

42704268
// Provide a flattened range to visit each binding.
42714269
auto flat_bindings() const {
4272-
llvm::ArrayRef<BindingDecl *> Bindings = bindings();
4273-
llvm::ArrayRef<BindingDecl *> PackBindings;
4270+
ArrayRef<BindingDecl *> Bindings = bindings();
4271+
ArrayRef<BindingDecl *> PackBindings;
42744272

42754273
// Split the bindings into subranges split by the pack.
4276-
llvm::ArrayRef<BindingDecl *> BeforePackBindings = Bindings.take_until(
4274+
ArrayRef<BindingDecl *> BeforePackBindings = Bindings.take_until(
42774275
[](BindingDecl *BD) { return BD->isParameterPack(); });
42784276

42794277
Bindings = Bindings.drop_front(BeforePackBindings.size());

clang/include/clang/AST/DeclObjC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext {
371371
// ArrayRef access to formal parameters. This should eventually
372372
// replace the iterator interface above.
373373
ArrayRef<ParmVarDecl*> parameters() const {
374-
return llvm::ArrayRef(const_cast<ParmVarDecl **>(getParams()), NumParams);
374+
return {const_cast<ParmVarDecl **>(getParams()), NumParams};
375375
}
376376

377377
ParmVarDecl *getParamDecl(unsigned Idx) {

clang/include/clang/AST/DeclOpenMP.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ class OMPThreadPrivateDecl final : public OMPDeclarativeDirective<Decl> {
118118

119119
ArrayRef<const Expr *> getVars() const {
120120
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
121-
return llvm::ArrayRef(Storage, Data->getNumChildren());
121+
return {Storage, Data->getNumChildren()};
122122
}
123123

124124
MutableArrayRef<Expr *> getVars() {
125125
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
126-
return llvm::MutableArrayRef(Storage, Data->getNumChildren());
126+
return {Storage, Data->getNumChildren()};
127127
}
128128

129129
void setVars(ArrayRef<Expr *> VL);
@@ -482,12 +482,12 @@ class OMPAllocateDecl final : public OMPDeclarativeDirective<Decl> {
482482

483483
ArrayRef<const Expr *> getVars() const {
484484
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
485-
return llvm::ArrayRef(Storage, Data->getNumChildren());
485+
return {Storage, Data->getNumChildren()};
486486
}
487487

488488
MutableArrayRef<Expr *> getVars() {
489489
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
490-
return llvm::MutableArrayRef(Storage, Data->getNumChildren());
490+
return {Storage, Data->getNumChildren()};
491491
}
492492

493493
void setVars(ArrayRef<Expr *> VL);

clang/include/clang/AST/DeclTemplate.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@ class TemplateParameterList final
139139
unsigned size() const { return NumParams; }
140140
bool empty() const { return NumParams == 0; }
141141

142-
ArrayRef<NamedDecl *> asArray() { return llvm::ArrayRef(begin(), end()); }
143-
ArrayRef<const NamedDecl*> asArray() const {
144-
return llvm::ArrayRef(begin(), size());
145-
}
142+
ArrayRef<NamedDecl *> asArray() { return {begin(), end()}; }
143+
ArrayRef<const NamedDecl *> asArray() const { return {begin(), size()}; }
146144

147145
NamedDecl* getParam(unsigned Idx) {
148146
assert(Idx < size() && "Template parameter index out-of-range");
@@ -772,7 +770,7 @@ class RedeclarableTemplateDecl : public TemplateDecl,
772770

773771
void loadLazySpecializationsImpl(bool OnlyPartial = false) const;
774772

775-
bool loadLazySpecializationsImpl(llvm::ArrayRef<TemplateArgument> Args,
773+
bool loadLazySpecializationsImpl(ArrayRef<TemplateArgument> Args,
776774
TemplateParameterList *TPL = nullptr) const;
777775

778776
template <class EntryType, typename... ProfileArguments>

clang/include/clang/AST/Expr.h

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3106,9 +3106,9 @@ class CallExpr : public Expr {
31063106
/// Compute and set dependence bits.
31073107
void computeDependence() {
31083108
setDependence(clang::computeDependence(
3109-
this, llvm::ArrayRef(
3110-
reinterpret_cast<Expr **>(getTrailingStmts() + PREARGS_START),
3111-
getNumPreArgs())));
3109+
this,
3110+
ArrayRef(reinterpret_cast<Expr **>(getTrailingStmts() + PREARGS_START),
3111+
getNumPreArgs())));
31123112
}
31133113

31143114
/// Reduce the number of arguments in this call expression. This is used for
@@ -3153,8 +3153,7 @@ class CallExpr : public Expr {
31533153
/// interface. This provides efficient reverse iteration of the
31543154
/// subexpressions. This is currently used for CFG construction.
31553155
ArrayRef<Stmt *> getRawSubExprs() {
3156-
return llvm::ArrayRef(getTrailingStmts(),
3157-
PREARGS_START + getNumPreArgs() + getNumArgs());
3156+
return {getTrailingStmts(), PREARGS_START + getNumPreArgs() + getNumArgs()};
31583157
}
31593158

31603159
/// Get FPOptionsOverride from trailing storage.
@@ -5276,11 +5275,9 @@ class InitListExpr : public Expr {
52765275
return reinterpret_cast<Expr * const *>(InitExprs.data());
52775276
}
52785277

5279-
ArrayRef<Expr *> inits() { return llvm::ArrayRef(getInits(), getNumInits()); }
5278+
ArrayRef<Expr *> inits() { return {getInits(), getNumInits()}; }
52805279

5281-
ArrayRef<Expr *> inits() const {
5282-
return llvm::ArrayRef(getInits(), getNumInits());
5283-
}
5280+
ArrayRef<Expr *> inits() const { return {getInits(), getNumInits()}; }
52845281

52855282
const Expr *getInit(unsigned Init) const {
52865283
assert(Init < getNumInits() && "Initializer access out of range!");
@@ -5508,7 +5505,7 @@ class DesignatedInitExpr final
55085505
Designator *Designators;
55095506

55105507
DesignatedInitExpr(const ASTContext &C, QualType Ty,
5511-
llvm::ArrayRef<Designator> Designators,
5508+
ArrayRef<Designator> Designators,
55125509
SourceLocation EqualOrColonLoc, bool GNUSyntax,
55135510
ArrayRef<Expr *> IndexExprs, Expr *Init);
55145511

@@ -5701,8 +5698,8 @@ class DesignatedInitExpr final
57015698
};
57025699

57035700
static DesignatedInitExpr *Create(const ASTContext &C,
5704-
llvm::ArrayRef<Designator> Designators,
5705-
ArrayRef<Expr*> IndexExprs,
5701+
ArrayRef<Designator> Designators,
5702+
ArrayRef<Expr *> IndexExprs,
57065703
SourceLocation EqualOrColonLoc,
57075704
bool GNUSyntax, Expr *Init);
57085705

@@ -5713,11 +5710,11 @@ class DesignatedInitExpr final
57135710
unsigned size() const { return NumDesignators; }
57145711

57155712
// Iterator access to the designators.
5716-
llvm::MutableArrayRef<Designator> designators() {
5713+
MutableArrayRef<Designator> designators() {
57175714
return {Designators, NumDesignators};
57185715
}
57195716

5720-
llvm::ArrayRef<Designator> designators() const {
5717+
ArrayRef<Designator> designators() const {
57215718
return {Designators, NumDesignators};
57225719
}
57235720

@@ -6052,7 +6049,7 @@ class ParenListExpr final
60526049

60536050
Expr **getExprs() { return reinterpret_cast<Expr **>(getTrailingObjects()); }
60546051

6055-
ArrayRef<Expr *> exprs() { return llvm::ArrayRef(getExprs(), getNumExprs()); }
6052+
ArrayRef<Expr *> exprs() { return {getExprs(), getNumExprs()}; }
60566053

60576054
SourceLocation getLParenLoc() const { return LParenLoc; }
60586055
SourceLocation getRParenLoc() const { return RParenLoc; }

clang/include/clang/AST/ExprObjC.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,7 @@ class ObjCMessageExpr final
14211421
if (hasStandardSelLocs())
14221422
return getStandardSelectorLoc(
14231423
Index, getSelector(), getSelLocsKind() == SelLoc_StandardWithSpace,
1424-
llvm::ArrayRef(const_cast<Expr **>(getArgs()), getNumArgs()),
1425-
RBracLoc);
1424+
ArrayRef(const_cast<Expr **>(getArgs()), getNumArgs()), RBracLoc);
14261425
return getStoredSelLocs()[Index];
14271426
}
14281427

clang/include/clang/AST/ExternalASTMerger.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class ExternalASTMerger : public ExternalASTSource {
113113

114114
public:
115115
ExternalASTMerger(const ImporterTarget &Target,
116-
llvm::ArrayRef<ImporterSource> Sources);
116+
ArrayRef<ImporterSource> Sources);
117117

118118
/// Asks all connected ASTImporters if any of them imported the given
119119
/// declaration. If any ASTImporter did import the given declaration,
@@ -128,7 +128,7 @@ class ExternalASTMerger : public ExternalASTSource {
128128
/// newly-parsed source files).
129129
///
130130
/// Ensures that Importers does not gain duplicate entries as a result.
131-
void AddSources(llvm::ArrayRef<ImporterSource> Sources);
131+
void AddSources(ArrayRef<ImporterSource> Sources);
132132

133133
/// Remove a set of ASTContexts as possible origins.
134134
///
@@ -137,7 +137,7 @@ class ExternalASTMerger : public ExternalASTSource {
137137
///
138138
/// The caller is responsible for ensuring that this doesn't leave
139139
/// DeclContexts that can't be completed.
140-
void RemoveSources(llvm::ArrayRef<ImporterSource> Sources);
140+
void RemoveSources(ArrayRef<ImporterSource> Sources);
141141

142142
/// Implementation of the ExternalASTSource API.
143143
bool FindExternalVisibleDeclsByName(const DeclContext *DC,

clang/include/clang/AST/OpenACCClause.h

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ class OpenACCClauseWithExprs : public OpenACCClauseWithParams {
513513

514514
/// Gets the entire list of expressions, but leave it to the
515515
/// individual clauses to expose this how they'd like.
516-
llvm::ArrayRef<Expr *> getExprs() const { return Exprs; }
516+
ArrayRef<Expr *> getExprs() const { return Exprs; }
517517

518518
public:
519519
static bool classof(const OpenACCClause *C);
@@ -563,10 +563,10 @@ class OpenACCWaitClause final
563563
SourceLocation getQueuesLoc() const { return QueuesLoc; }
564564
bool hasDevNumExpr() const { return getExprs()[0]; }
565565
Expr *getDevNumExpr() const { return getExprs()[0]; }
566-
llvm::ArrayRef<Expr *> getQueueIdExprs() {
566+
ArrayRef<Expr *> getQueueIdExprs() {
567567
return OpenACCClauseWithExprs::getExprs().drop_front();
568568
}
569-
llvm::ArrayRef<Expr *> getQueueIdExprs() const {
569+
ArrayRef<Expr *> getQueueIdExprs() const {
570570
return OpenACCClauseWithExprs::getExprs().drop_front();
571571
}
572572
// If this is a plain `wait` (no parens) this returns 'false'. Else Sema/Parse
@@ -594,11 +594,9 @@ class OpenACCNumGangsClause final
594594
Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
595595
ArrayRef<Expr *> IntExprs, SourceLocation EndLoc);
596596

597-
llvm::ArrayRef<Expr *> getIntExprs() {
598-
return OpenACCClauseWithExprs::getExprs();
599-
}
597+
ArrayRef<Expr *> getIntExprs() { return OpenACCClauseWithExprs::getExprs(); }
600598

601-
llvm::ArrayRef<Expr *> getIntExprs() const {
599+
ArrayRef<Expr *> getIntExprs() const {
602600
return OpenACCClauseWithExprs::getExprs();
603601
}
604602
};
@@ -622,11 +620,9 @@ class OpenACCTileClause final
622620
SourceLocation LParenLoc,
623621
ArrayRef<Expr *> SizeExprs,
624622
SourceLocation EndLoc);
625-
llvm::ArrayRef<Expr *> getSizeExprs() {
626-
return OpenACCClauseWithExprs::getExprs();
627-
}
623+
ArrayRef<Expr *> getSizeExprs() { return OpenACCClauseWithExprs::getExprs(); }
628624

629-
llvm::ArrayRef<Expr *> getSizeExprs() const {
625+
ArrayRef<Expr *> getSizeExprs() const {
630626
return OpenACCClauseWithExprs::getExprs();
631627
}
632628
};

0 commit comments

Comments
 (0)