Skip to content

Commit 3c87dfe

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

Some content is hidden

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

45 files changed

+181
-202
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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,9 +3424,7 @@ class IndirectFieldDecl : public ValueDecl,
34243424

34253425
using chain_iterator = ArrayRef<NamedDecl *>::const_iterator;
34263426

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

clang/include/clang/AST/DeclCXX.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,11 @@ class CXXRecordDecl : public RecordDecl {
366366
}
367367

368368
ArrayRef<CXXBaseSpecifier> bases() const {
369-
return llvm::ArrayRef(getBases(), NumBases);
369+
return ArrayRef(getBases(), NumBases);
370370
}
371371

372372
ArrayRef<CXXBaseSpecifier> vbases() const {
373-
return llvm::ArrayRef(getVBases(), NumVBases);
373+
return ArrayRef(getVBases(), NumVBases);
374374
}
375375

376376
private:
@@ -4190,7 +4190,7 @@ class BindingDecl : public ValueDecl {
41904190
Expr *getBinding() const { return Binding; }
41914191

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

41954195
/// Get the decomposition declaration that this binding represents a
41964196
/// decomposition of.
@@ -4269,11 +4269,11 @@ class DecompositionDecl final
42694269

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

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

42794279
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 ArrayRef(const_cast<ParmVarDecl **>(getParams()), NumParams);
375375
}
376376

377377
ParmVarDecl *getParamDecl(unsigned Idx) {

clang/include/clang/AST/DeclOpenMP.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ 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 ArrayRef(Storage, Data->getNumChildren());
122122
}
123123

124124
MutableArrayRef<Expr *> getVars() {
@@ -482,7 +482,7 @@ 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 ArrayRef(Storage, Data->getNumChildren());
486486
}
487487

488488
MutableArrayRef<Expr *> getVars() {

clang/include/clang/AST/DeclTemplate.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ 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()); }
142+
ArrayRef<NamedDecl *> asArray() { return ArrayRef(begin(), end()); }
143143
ArrayRef<const NamedDecl*> asArray() const {
144-
return llvm::ArrayRef(begin(), size());
144+
return ArrayRef(begin(), size());
145145
}
146146

147147
NamedDecl* getParam(unsigned Idx) {
@@ -772,7 +772,7 @@ class RedeclarableTemplateDecl : public TemplateDecl,
772772

773773
void loadLazySpecializationsImpl(bool OnlyPartial = false) const;
774774

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

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

clang/include/clang/AST/Expr.h

Lines changed: 12 additions & 14 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,8 @@ 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 ArrayRef(getTrailingStmts(),
3157+
PREARGS_START + getNumPreArgs() + getNumArgs());
31583158
}
31593159

31603160
/// Get FPOptionsOverride from trailing storage.
@@ -5276,11 +5276,9 @@ class InitListExpr : public Expr {
52765276
return reinterpret_cast<Expr * const *>(InitExprs.data());
52775277
}
52785278

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

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

52855283
const Expr *getInit(unsigned Init) const {
52865284
assert(Init < getNumInits() && "Initializer access out of range!");
@@ -5508,7 +5506,7 @@ class DesignatedInitExpr final
55085506
Designator *Designators;
55095507

55105508
DesignatedInitExpr(const ASTContext &C, QualType Ty,
5511-
llvm::ArrayRef<Designator> Designators,
5509+
ArrayRef<Designator> Designators,
55125510
SourceLocation EqualOrColonLoc, bool GNUSyntax,
55135511
ArrayRef<Expr *> IndexExprs, Expr *Init);
55145512

@@ -5701,8 +5699,8 @@ class DesignatedInitExpr final
57015699
};
57025700

57035701
static DesignatedInitExpr *Create(const ASTContext &C,
5704-
llvm::ArrayRef<Designator> Designators,
5705-
ArrayRef<Expr*> IndexExprs,
5702+
ArrayRef<Designator> Designators,
5703+
ArrayRef<Expr *> IndexExprs,
57065704
SourceLocation EqualOrColonLoc,
57075705
bool GNUSyntax, Expr *Init);
57085706

@@ -5717,7 +5715,7 @@ class DesignatedInitExpr final
57175715
return {Designators, NumDesignators};
57185716
}
57195717

5720-
llvm::ArrayRef<Designator> designators() const {
5718+
ArrayRef<Designator> designators() const {
57215719
return {Designators, NumDesignators};
57225720
}
57235721

@@ -6052,7 +6050,7 @@ class ParenListExpr final
60526050

60536051
Expr **getExprs() { return reinterpret_cast<Expr **>(getTrailingObjects()); }
60546052

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

60576055
SourceLocation getLParenLoc() const { return LParenLoc; }
60586056
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)