Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit cfa88f8

Browse files
committed
Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 9cd506b commit cfa88f8

File tree

184 files changed

+577
-597
lines changed

Some content is hidden

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

184 files changed

+577
-597
lines changed

Diff for: examples/clang-interpreter/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ int main(int argc, const char **argv, char * const *envp) {
8181
// FIXME: This is a hack to try to force the driver to do something we can
8282
// recognize. We need to extend the driver library to support this use model
8383
// (basically, exactly one input, and the operation mode is hard wired).
84-
llvm::SmallVector<const char *, 16> Args(argv, argv + argc);
84+
SmallVector<const char *, 16> Args(argv, argv + argc);
8585
Args.push_back("-fsyntax-only");
8686
OwningPtr<Compilation> C(TheDriver.BuildCompilation(Args));
8787
if (!C)

Diff for: include/clang/AST/Attr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Attr {
8888
virtual bool isLateParsed() const { return false; }
8989

9090
// Pretty print this attribute.
91-
virtual void printPretty(llvm::raw_ostream &OS,
91+
virtual void printPretty(raw_ostream &OS,
9292
const PrintingPolicy &Policy) const = 0;
9393
};
9494

Diff for: include/clang/AST/Comment.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Comment {
172172

173173
LLVM_ATTRIBUTE_USED void dump() const;
174174
LLVM_ATTRIBUTE_USED void dump(const ASTContext &Context) const;
175-
void dump(llvm::raw_ostream &OS, const CommandTraits *Traits,
175+
void dump(raw_ostream &OS, const CommandTraits *Traits,
176176
const SourceManager *SM) const;
177177

178178
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
@@ -282,14 +282,14 @@ class InlineCommandComment : public InlineContentComment {
282282

283283
protected:
284284
/// Command arguments.
285-
llvm::ArrayRef<Argument> Args;
285+
ArrayRef<Argument> Args;
286286

287287
public:
288288
InlineCommandComment(SourceLocation LocBegin,
289289
SourceLocation LocEnd,
290290
unsigned CommandID,
291291
RenderKind RK,
292-
llvm::ArrayRef<Argument> Args) :
292+
ArrayRef<Argument> Args) :
293293
InlineContentComment(InlineCommandCommentKind, LocBegin, LocEnd),
294294
Args(Args) {
295295
InlineCommandCommentBits.RenderKind = RK;
@@ -504,10 +504,10 @@ class BlockContentComment : public Comment {
504504

505505
/// A single paragraph that contains inline content.
506506
class ParagraphComment : public BlockContentComment {
507-
llvm::ArrayRef<InlineContentComment *> Content;
507+
ArrayRef<InlineContentComment *> Content;
508508

509509
public:
510-
ParagraphComment(llvm::ArrayRef<InlineContentComment *> Content) :
510+
ParagraphComment(ArrayRef<InlineContentComment *> Content) :
511511
BlockContentComment(ParagraphCommentKind,
512512
SourceLocation(),
513513
SourceLocation()),
@@ -565,7 +565,7 @@ class BlockCommandComment : public BlockContentComment {
565565

566566
protected:
567567
/// Word-like arguments.
568-
llvm::ArrayRef<Argument> Args;
568+
ArrayRef<Argument> Args;
569569

570570
/// Paragraph argument.
571571
ParagraphComment *Paragraph;
@@ -633,7 +633,7 @@ class BlockCommandComment : public BlockContentComment {
633633
return Args[Idx].Range;
634634
}
635635

636-
void setArgs(llvm::ArrayRef<Argument> A) {
636+
void setArgs(ArrayRef<Argument> A) {
637637
Args = A;
638638
if (Args.size() > 0) {
639639
SourceLocation NewLocEnd = Args.back().Range.getEnd();
@@ -746,7 +746,7 @@ class TParamCommandComment : public BlockCommandComment {
746746
/// For C: Position = { 0 }
747747
/// For TT: Position = { 1 }
748748
/// For T: Position = { 1, 0 }
749-
llvm::ArrayRef<unsigned> Position;
749+
ArrayRef<unsigned> Position;
750750

751751
public:
752752
TParamCommandComment(SourceLocation LocBegin,
@@ -826,7 +826,7 @@ class VerbatimBlockComment : public BlockCommandComment {
826826
protected:
827827
StringRef CloseName;
828828
SourceLocation CloseNameLocBegin;
829-
llvm::ArrayRef<VerbatimBlockLineComment *> Lines;
829+
ArrayRef<VerbatimBlockLineComment *> Lines;
830830

831831
public:
832832
VerbatimBlockComment(SourceLocation LocBegin,
@@ -853,7 +853,7 @@ class VerbatimBlockComment : public BlockCommandComment {
853853
CloseNameLocBegin = LocBegin;
854854
}
855855

856-
void setLines(llvm::ArrayRef<VerbatimBlockLineComment *> L) {
856+
void setLines(ArrayRef<VerbatimBlockLineComment *> L) {
857857
Lines = L;
858858
}
859859

@@ -1021,11 +1021,11 @@ struct DeclInfo {
10211021

10221022
/// A full comment attached to a declaration, contains block content.
10231023
class FullComment : public Comment {
1024-
llvm::ArrayRef<BlockContentComment *> Blocks;
1024+
ArrayRef<BlockContentComment *> Blocks;
10251025
DeclInfo *ThisDeclInfo;
10261026

10271027
public:
1028-
FullComment(llvm::ArrayRef<BlockContentComment *> Blocks, DeclInfo *D) :
1028+
FullComment(ArrayRef<BlockContentComment *> Blocks, DeclInfo *D) :
10291029
Comment(FullCommentKind, SourceLocation(), SourceLocation()),
10301030
Blocks(Blocks), ThisDeclInfo(D) {
10311031
if (Blocks.empty())
@@ -1062,7 +1062,7 @@ class FullComment : public Comment {
10621062
return ThisDeclInfo;
10631063
}
10641064

1065-
llvm::ArrayRef<BlockContentComment *> getBlocks() const { return Blocks; }
1065+
ArrayRef<BlockContentComment *> getBlocks() const { return Blocks; }
10661066

10671067
};
10681068
} // end namespace comments

Diff for: include/clang/AST/Decl.h

+8-9
Original file line numberDiff line numberDiff line change
@@ -1093,8 +1093,7 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
10931093
/// not a constant expression. Returns a pointer to the value if evaluation
10941094
/// succeeded, 0 otherwise.
10951095
APValue *evaluateValue() const;
1096-
APValue *evaluateValue(
1097-
llvm::SmallVectorImpl<PartialDiagnosticAt> &Notes) const;
1096+
APValue *evaluateValue(SmallVectorImpl<PartialDiagnosticAt> &Notes) const;
10981097

10991098
/// \brief Return the already-evaluated value of this variable's
11001099
/// initializer, or NULL if the value is not yet known. Returns pointer
@@ -1457,7 +1456,7 @@ class FunctionDecl : public DeclaratorDecl, public DeclContext,
14571456
/// DeclsInPrototypeScope - Array of pointers to NamedDecls for
14581457
/// decls defined in the function prototype that are not parameters. E.g.
14591458
/// 'enum Y' in 'void f(enum Y {AA} x) {}'.
1460-
llvm::ArrayRef<NamedDecl*> DeclsInPrototypeScope;
1459+
ArrayRef<NamedDecl *> DeclsInPrototypeScope;
14611460

14621461
LazyDeclStmtPtr Body;
14631462

@@ -1548,7 +1547,7 @@ class FunctionDecl : public DeclaratorDecl, public DeclContext,
15481547
void setInstantiationOfMemberFunction(ASTContext &C, FunctionDecl *FD,
15491548
TemplateSpecializationKind TSK);
15501549

1551-
void setParams(ASTContext &C, llvm::ArrayRef<ParmVarDecl *> NewParamInfo);
1550+
void setParams(ASTContext &C, ArrayRef<ParmVarDecl *> NewParamInfo);
15521551

15531552
protected:
15541553
FunctionDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc,
@@ -1835,14 +1834,14 @@ class FunctionDecl : public DeclaratorDecl, public DeclContext,
18351834
assert(i < getNumParams() && "Illegal param #");
18361835
return ParamInfo[i];
18371836
}
1838-
void setParams(llvm::ArrayRef<ParmVarDecl *> NewParamInfo) {
1837+
void setParams(ArrayRef<ParmVarDecl *> NewParamInfo) {
18391838
setParams(getASTContext(), NewParamInfo);
18401839
}
18411840

1842-
const llvm::ArrayRef<NamedDecl*> &getDeclsInPrototypeScope() const {
1841+
const ArrayRef<NamedDecl *> &getDeclsInPrototypeScope() const {
18431842
return DeclsInPrototypeScope;
18441843
}
1845-
void setDeclsInPrototypeScope(llvm::ArrayRef<NamedDecl *> NewDecls);
1844+
void setDeclsInPrototypeScope(ArrayRef<NamedDecl *> NewDecls);
18461845

18471846
/// getMinRequiredArguments - Returns the minimum number of arguments
18481847
/// needed to call this function. This may be fewer than the number of
@@ -3182,7 +3181,7 @@ class BlockDecl : public Decl, public DeclContext {
31823181
assert(i < getNumParams() && "Illegal param #");
31833182
return ParamInfo[i];
31843183
}
3185-
void setParams(llvm::ArrayRef<ParmVarDecl *> NewParamInfo);
3184+
void setParams(ArrayRef<ParmVarDecl *> NewParamInfo);
31863185

31873186
/// hasCaptures - True if this block (or its nested blocks) captures
31883187
/// anything of local storage from its enclosing scopes.
@@ -3323,7 +3322,7 @@ void Redeclarable<decl_type>::setPreviousDeclaration(decl_type *PrevDecl) {
33233322
First = PrevDecl->getFirstDeclaration();
33243323
assert(First->RedeclLink.NextIsLatest() && "Expected first");
33253324
decl_type *MostRecent = First->RedeclLink.getNext();
3326-
RedeclLink = PreviousDeclLink(llvm::cast<decl_type>(MostRecent));
3325+
RedeclLink = PreviousDeclLink(cast<decl_type>(MostRecent));
33273326
} else {
33283327
// Make this first.
33293328
First = static_cast<decl_type*>(this);

Diff for: include/clang/AST/DeclBase.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ class PrettyStackTraceDecl : public llvm::PrettyStackTraceEntry {
904904

905905
typedef llvm::MutableArrayRef<NamedDecl*> DeclContextLookupResult;
906906

907-
typedef llvm::ArrayRef<NamedDecl*> DeclContextLookupConstResult;
907+
typedef ArrayRef<NamedDecl *> DeclContextLookupConstResult;
908908

909909
/// DeclContext - This is used only as base class of specific decl types that
910910
/// can act as declaration contexts. These decls are (only the top classes
@@ -1151,7 +1151,7 @@ class DeclContext {
11511151
/// contexts that are semanticaly connected to this declaration context,
11521152
/// in source order, including this context (which may be the only result,
11531153
/// for non-namespace contexts).
1154-
void collectAllContexts(llvm::SmallVectorImpl<DeclContext *> &Contexts);
1154+
void collectAllContexts(SmallVectorImpl<DeclContext *> &Contexts);
11551155

11561156
/// decl_iterator - Iterates through the declarations stored
11571157
/// within this context.
@@ -1414,7 +1414,7 @@ class DeclContext {
14141414
/// usual relationship between a DeclContext and the external source.
14151415
/// See the ASTImporter for the (few, but important) use cases.
14161416
void localUncachedLookup(DeclarationName Name,
1417-
llvm::SmallVectorImpl<NamedDecl *> &Results);
1417+
SmallVectorImpl<NamedDecl *> &Results);
14181418

14191419
/// @brief Makes a declaration visible within this context.
14201420
///

Diff for: include/clang/AST/DeclTemplate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ class TemplateTemplateParmDecl : public TemplateDecl,
12051205
unsigned P,
12061206
IdentifierInfo *Id,
12071207
TemplateParameterList *Params,
1208-
llvm::ArrayRef<TemplateParameterList*> Expansions);
1208+
ArrayRef<TemplateParameterList *> Expansions);
12091209

12101210
static TemplateTemplateParmDecl *CreateDeserialized(ASTContext &C,
12111211
unsigned ID);

Diff for: include/clang/AST/Expr.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ class Expr : public Stmt {
490490
/// constexpr. Return false if the function can never produce a constant
491491
/// expression, along with diagnostics describing why not.
492492
static bool isPotentialConstantExpr(const FunctionDecl *FD,
493-
llvm::SmallVectorImpl<
493+
SmallVectorImpl<
494494
PartialDiagnosticAt> &Diags);
495495

496496
/// isConstantInitializer - Returns true if this expression can be emitted to
@@ -510,7 +510,7 @@ class Expr : public Stmt {
510510
/// foldable. If the expression is foldable, but not a constant expression,
511511
/// the notes will describes why it isn't a constant expression. If the
512512
/// expression *is* a constant expression, no notes will be produced.
513-
llvm::SmallVectorImpl<PartialDiagnosticAt> *Diag;
513+
SmallVectorImpl<PartialDiagnosticAt> *Diag;
514514

515515
EvalStatus() : HasSideEffects(false), Diag(0) {}
516516

@@ -569,7 +569,7 @@ class Expr : public Stmt {
569569
/// integer. This must be called on an expression that constant folds to an
570570
/// integer.
571571
llvm::APSInt EvaluateKnownConstInt(const ASTContext &Ctx,
572-
llvm::SmallVectorImpl<PartialDiagnosticAt> *Diag=0) const;
572+
SmallVectorImpl<PartialDiagnosticAt> *Diag=0) const;
573573

574574
/// EvaluateAsLValue - Evaluate an expression to see if we can fold it to an
575575
/// lvalue with link time known address, with no side-effects.
@@ -581,7 +581,7 @@ class Expr : public Stmt {
581581
/// notes will be produced if the expression is not a constant expression.
582582
bool EvaluateAsInitializer(APValue &Result, const ASTContext &Ctx,
583583
const VarDecl *VD,
584-
llvm::SmallVectorImpl<PartialDiagnosticAt> &Notes) const;
584+
SmallVectorImpl<PartialDiagnosticAt> &Notes) const;
585585

586586
/// \brief Enumeration used to describe the kind of Null pointer constant
587587
/// returned from \c isNullPointerConstant().
@@ -729,7 +729,7 @@ class Expr : public Stmt {
729729
return const_cast<Expr*>(this)->IgnoreParenNoopCasts(Ctx);
730730
}
731731

732-
static bool hasAnyTypeDependentArguments(llvm::ArrayRef<Expr *> Exprs);
732+
static bool hasAnyTypeDependentArguments(ArrayRef<Expr *> Exprs);
733733

734734
/// \brief For an expression of class type or pointer to class type,
735735
/// return the most derived class decl the expression is known to refer to.

Diff for: include/clang/AST/ExprCXX.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3631,7 +3631,7 @@ class FunctionParmPackExpr : public Expr {
36313631
static FunctionParmPackExpr *Create(ASTContext &Context, QualType T,
36323632
ParmVarDecl *ParamPack,
36333633
SourceLocation NameLoc,
3634-
llvm::ArrayRef<Decl*> Params);
3634+
ArrayRef<Decl *> Params);
36353635
static FunctionParmPackExpr *CreateEmpty(ASTContext &Context,
36363636
unsigned NumParams);
36373637

Diff for: include/clang/AST/ExprObjC.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class ObjCArrayLiteral : public Expr {
135135
SourceRange Range;
136136
ObjCMethodDecl *ArrayWithObjectsMethod;
137137

138-
ObjCArrayLiteral(llvm::ArrayRef<Expr *> Elements,
138+
ObjCArrayLiteral(ArrayRef<Expr *> Elements,
139139
QualType T, ObjCMethodDecl * Method,
140140
SourceRange SR);
141141

@@ -144,7 +144,7 @@ class ObjCArrayLiteral : public Expr {
144144

145145
public:
146146
static ObjCArrayLiteral *Create(ASTContext &C,
147-
llvm::ArrayRef<Expr *> Elements,
147+
ArrayRef<Expr *> Elements,
148148
QualType T, ObjCMethodDecl * Method,
149149
SourceRange SR);
150150

Diff for: include/clang/AST/LambdaMangleContext.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef LLVM_CLANG_LAMBDAMANGLECONTEXT_H
1515
#define LLVM_CLANG_LAMBDAMANGLECONTEXT_H
1616

17+
#include "clang/Basic/LLVM.h"
1718
#include "llvm/ADT/DenseMap.h"
1819
#include "llvm/ADT/IntrusiveRefCntPtr.h"
1920

@@ -24,7 +25,7 @@ class FunctionProtoType;
2425

2526
/// \brief Keeps track of the mangled names of lambda expressions within a
2627
/// particular context.
27-
class LambdaMangleContext : public llvm::RefCountedBase<LambdaMangleContext> {
28+
class LambdaMangleContext : public RefCountedBase<LambdaMangleContext> {
2829
llvm::DenseMap<const FunctionProtoType *, unsigned> ManglingNumbers;
2930

3031
public:

Diff for: include/clang/AST/Stmt.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ class SEHExceptStmt : public Stmt {
17731773
}
17741774

17751775
CompoundStmt *getBlock() const {
1776-
return llvm::cast<CompoundStmt>(Children[BLOCK]);
1776+
return cast<CompoundStmt>(Children[BLOCK]);
17771777
}
17781778

17791779
child_range children() {
@@ -1808,7 +1808,7 @@ class SEHFinallyStmt : public Stmt {
18081808
SourceLocation getFinallyLoc() const { return Loc; }
18091809
SourceLocation getEndLoc() const { return Block->getLocEnd(); }
18101810

1811-
CompoundStmt *getBlock() const { return llvm::cast<CompoundStmt>(Block); }
1811+
CompoundStmt *getBlock() const { return cast<CompoundStmt>(Block); }
18121812

18131813
child_range children() {
18141814
return child_range(&Block,&Block+1);
@@ -1852,7 +1852,7 @@ class SEHTryStmt : public Stmt {
18521852
bool getIsCXXTry() const { return IsCXXTry; }
18531853

18541854
CompoundStmt* getTryBlock() const {
1855-
return llvm::cast<CompoundStmt>(Children[TRY]);
1855+
return cast<CompoundStmt>(Children[TRY]);
18561856
}
18571857

18581858
Stmt *getHandler() const { return Children[HANDLER]; }

Diff for: include/clang/AST/StmtCXX.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@ class CXXTryStmt : public Stmt {
9494
}
9595

9696
CompoundStmt *getTryBlock() {
97-
return llvm::cast<CompoundStmt>(getStmts()[0]);
97+
return cast<CompoundStmt>(getStmts()[0]);
9898
}
9999
const CompoundStmt *getTryBlock() const {
100-
return llvm::cast<CompoundStmt>(getStmts()[0]);
100+
return cast<CompoundStmt>(getStmts()[0]);
101101
}
102102

103103
unsigned getNumHandlers() const { return NumHandlers; }
104104
CXXCatchStmt *getHandler(unsigned i) {
105-
return llvm::cast<CXXCatchStmt>(getStmts()[i + 1]);
105+
return cast<CXXCatchStmt>(getStmts()[i + 1]);
106106
}
107107
const CXXCatchStmt *getHandler(unsigned i) const {
108-
return llvm::cast<CXXCatchStmt>(getStmts()[i + 1]);
108+
return cast<CXXCatchStmt>(getStmts()[i + 1]);
109109
}
110110

111111
static bool classof(const Stmt *T) {

Diff for: include/clang/ASTMatchers/ASTMatchers.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -1228,8 +1228,8 @@ inline internal::Matcher<Stmt> sizeOfExpr(
12281228
AST_MATCHER_P(NamedDecl, hasName, std::string, Name) {
12291229
assert(!Name.empty());
12301230
const std::string FullNameString = "::" + Node.getQualifiedNameAsString();
1231-
const llvm::StringRef FullName = FullNameString;
1232-
const llvm::StringRef Pattern = Name;
1231+
const StringRef FullName = FullNameString;
1232+
const StringRef Pattern = Name;
12331233
if (Pattern.startswith("::")) {
12341234
return FullName == Pattern;
12351235
} else {
@@ -1705,8 +1705,7 @@ AST_MATCHER_P(DeclRefExpr, to, internal::Matcher<Decl>,
17051705
AST_MATCHER_P(DeclRefExpr, throughUsingDecl,
17061706
internal::Matcher<UsingShadowDecl>, InnerMatcher) {
17071707
const NamedDecl *FoundDecl = Node.getFoundDecl();
1708-
if (const UsingShadowDecl *UsingDecl =
1709-
llvm::dyn_cast<UsingShadowDecl>(FoundDecl))
1708+
if (const UsingShadowDecl *UsingDecl = dyn_cast<UsingShadowDecl>(FoundDecl))
17101709
return InnerMatcher.matches(*UsingDecl, Finder, Builder);
17111710
return false;
17121711
}

0 commit comments

Comments
 (0)