diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-20 06:58:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-20 06:58:45 +0000 |
commit | 686775deca8b8685eb90801495880e3abdd844c2 (patch) | |
tree | 64e6e34d0e6d1078631305a3f1ac1dfb821f4a59 /lib | |
parent | 9594675cc1eb52a054de13c4a21e466643847480 (diff) |
now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector. This cleans up the codebase
quite a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ARCMigrate/Internals.h | 20 | ||||
-rw-r--r-- | lib/CodeGen/CGCXXABI.h | 4 | ||||
-rw-r--r-- | lib/CodeGen/CGCall.h | 10 | ||||
-rw-r--r-- | lib/CodeGen/CGCleanup.h | 4 | ||||
-rw-r--r-- | lib/CodeGen/CGDebugInfo.h | 28 | ||||
-rw-r--r-- | lib/CodeGen/CGException.h | 12 | ||||
-rw-r--r-- | lib/CodeGen/CGVTables.h | 4 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 16 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 22 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenTBAA.h | 4 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenTypes.h | 8 | ||||
-rw-r--r-- | lib/CodeGen/TargetInfo.h | 5 | ||||
-rw-r--r-- | lib/Driver/ToolChains.h | 2 | ||||
-rw-r--r-- | lib/Index/EntityImpl.h | 2 | ||||
-rw-r--r-- | lib/Sema/TreeTransform.h | 42 |
15 files changed, 92 insertions, 91 deletions
diff --git a/lib/ARCMigrate/Internals.h b/lib/ARCMigrate/Internals.h index acbb0a56b6..a9ab093f3a 100644 --- a/lib/ARCMigrate/Internals.h +++ b/lib/ARCMigrate/Internals.h @@ -57,15 +57,15 @@ public: bool commitTransaction(); void abortTransaction(); - void insert(SourceLocation loc, llvm::StringRef text); - void insertAfterToken(SourceLocation loc, llvm::StringRef text); + void insert(SourceLocation loc, StringRef text); + void insertAfterToken(SourceLocation loc, StringRef text); void remove(SourceRange range); void removeStmt(Stmt *S); - void replace(SourceRange range, llvm::StringRef text); + void replace(SourceRange range, StringRef text); void replace(SourceRange range, SourceRange replacementRange); - void replaceStmt(Stmt *S, llvm::StringRef text); - void replaceText(SourceLocation loc, llvm::StringRef text, - llvm::StringRef replacementText); + void replaceStmt(Stmt *S, StringRef text); + void replaceText(SourceLocation loc, StringRef text, + StringRef replacementText); void increaseIndentation(SourceRange range, SourceLocation parentIndent); @@ -92,9 +92,9 @@ public: return CapturedDiags.hasDiagnostic(IDs, range); } - void reportError(llvm::StringRef error, SourceLocation loc, + void reportError(StringRef error, SourceLocation loc, SourceRange range = SourceRange()); - void reportNote(llvm::StringRef note, SourceLocation loc, + void reportNote(StringRef note, SourceLocation loc, SourceRange range = SourceRange()); bool hasReportedErrors() const { return ReportedErrors; } @@ -103,7 +103,7 @@ public: public: virtual ~RewriteReceiver(); - virtual void insert(SourceLocation loc, llvm::StringRef text) = 0; + virtual void insert(SourceLocation loc, StringRef text) = 0; virtual void remove(CharSourceRange range) = 0; virtual void increaseIndentation(CharSourceRange range, SourceLocation parentIndent) = 0; @@ -148,7 +148,7 @@ public: bool isARCDiagnostic(unsigned diagID, Diagnostic &Diag); -static inline llvm::StringRef getARCMTMacroName() { +static inline StringRef getARCMTMacroName() { return "__IMPL_ARCMT_REMOVED_EXPR__"; } diff --git a/lib/CodeGen/CGCXXABI.h b/lib/CodeGen/CGCXXABI.h index 29f299a43e..8c0df38ff1 100644 --- a/lib/CodeGen/CGCXXABI.h +++ b/lib/CodeGen/CGCXXABI.h @@ -151,7 +151,7 @@ public: virtual void BuildConstructorSignature(const CXXConstructorDecl *Ctor, CXXCtorType T, CanQualType &ResTy, - llvm::SmallVectorImpl<CanQualType> &ArgTys) = 0; + SmallVectorImpl<CanQualType> &ArgTys) = 0; /// Build the signature of the given destructor variant by adding /// any required parameters. For convenience, ResTy has been @@ -160,7 +160,7 @@ public: virtual void BuildDestructorSignature(const CXXDestructorDecl *Dtor, CXXDtorType T, CanQualType &ResTy, - llvm::SmallVectorImpl<CanQualType> &ArgTys) = 0; + SmallVectorImpl<CanQualType> &ArgTys) = 0; /// Build the ABI-specific portion of the parameter list for a /// function. This generally involves a 'this' parameter and diff --git a/lib/CodeGen/CGCall.h b/lib/CodeGen/CGCall.h index 343b944bf6..24ed366dd8 100644 --- a/lib/CodeGen/CGCall.h +++ b/lib/CodeGen/CGCall.h @@ -42,7 +42,7 @@ namespace clang { class VarDecl; namespace CodeGen { - typedef llvm::SmallVector<llvm::AttributeWithIndex, 8> AttributeListType; + typedef SmallVector<llvm::AttributeWithIndex, 8> AttributeListType; struct CallArg { RValue RV; @@ -56,7 +56,7 @@ namespace CodeGen { /// CallArgList - Type for representing both the value and type of /// arguments in a call. class CallArgList : - public llvm::SmallVector<CallArg, 16> { + public SmallVector<CallArg, 16> { public: struct Writeback { /// The original argument. @@ -90,18 +90,18 @@ namespace CodeGen { bool hasWritebacks() const { return !Writebacks.empty(); } - typedef llvm::SmallVectorImpl<Writeback>::const_iterator writeback_iterator; + typedef SmallVectorImpl<Writeback>::const_iterator writeback_iterator; writeback_iterator writeback_begin() const { return Writebacks.begin(); } writeback_iterator writeback_end() const { return Writebacks.end(); } private: - llvm::SmallVector<Writeback, 1> Writebacks; + SmallVector<Writeback, 1> Writebacks; }; /// FunctionArgList - Type for representing both the decl and type /// of parameters to a function. The decl must be either a /// ParmVarDecl or ImplicitParamDecl. - class FunctionArgList : public llvm::SmallVector<const VarDecl*, 16> { + class FunctionArgList : public SmallVector<const VarDecl*, 16> { }; /// CGFunctionInfo - Class to encapsulate the information about a diff --git a/lib/CodeGen/CGCleanup.h b/lib/CodeGen/CGCleanup.h index c93ec5bb76..9cf04bf79a 100644 --- a/lib/CodeGen/CGCleanup.h +++ b/lib/CodeGen/CGCleanup.h @@ -178,7 +178,7 @@ class EHCleanupScope : public EHScope { llvm::SmallPtrSet<llvm::BasicBlock*, 4> Branches; /// Normal branch-afters. - llvm::SmallVector<std::pair<llvm::BasicBlock*,llvm::ConstantInt*>, 4> + SmallVector<std::pair<llvm::BasicBlock*,llvm::ConstantInt*>, 4> BranchAfters; /// The destinations of EH branch-afters and branch-throughs. @@ -187,7 +187,7 @@ class EHCleanupScope : public EHScope { llvm::SmallPtrSet<llvm::BasicBlock*, 4> EHBranches; /// EH branch-afters. - llvm::SmallVector<std::pair<llvm::BasicBlock*,llvm::ConstantInt*>, 4> + SmallVector<std::pair<llvm::BasicBlock*,llvm::ConstantInt*>, 4> EHBranchAfters; }; mutable struct ExtInfo *ExtInfo; diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h index f87d0072e3..09e4628f47 100644 --- a/lib/CodeGen/CGDebugInfo.h +++ b/lib/CodeGen/CGDebugInfo.h @@ -70,7 +70,7 @@ class CGDebugInfo { /// DebugInfoNames - This is a storage for names that are /// constructed on demand. For example, C++ destructors, C++ operators etc.. llvm::BumpPtrAllocator DebugInfoNames; - llvm::StringRef CWDName; + StringRef CWDName; llvm::DenseMap<const char *, llvm::WeakVH> DIFileCache; llvm::DenseMap<const FunctionDecl *, llvm::WeakVH> SPCache; @@ -113,17 +113,17 @@ class CGDebugInfo { void CollectCXXMemberFunctions(const CXXRecordDecl *Decl, llvm::DIFile F, - llvm::SmallVectorImpl<llvm::Value *> &E, + SmallVectorImpl<llvm::Value *> &E, llvm::DIType T); void CollectCXXFriends(const CXXRecordDecl *Decl, llvm::DIFile F, - llvm::SmallVectorImpl<llvm::Value *> &EltTys, + SmallVectorImpl<llvm::Value *> &EltTys, llvm::DIType RecordTy); void CollectCXXBases(const CXXRecordDecl *Decl, llvm::DIFile F, - llvm::SmallVectorImpl<llvm::Value *> &EltTys, + SmallVectorImpl<llvm::Value *> &EltTys, llvm::DIType RecordTy); llvm::DIArray @@ -136,18 +136,18 @@ class CGDebugInfo { CollectCXXTemplateParams(const ClassTemplateSpecializationDecl *TS, llvm::DIFile F); - llvm::DIType createFieldType(llvm::StringRef name, QualType type, + llvm::DIType createFieldType(StringRef name, QualType type, Expr *bitWidth, SourceLocation loc, AccessSpecifier AS, uint64_t offsetInBits, llvm::DIFile tunit, llvm::DIDescriptor scope); void CollectRecordFields(const RecordDecl *Decl, llvm::DIFile F, - llvm::SmallVectorImpl<llvm::Value *> &E, + SmallVectorImpl<llvm::Value *> &E, llvm::DIType RecordTy); void CollectVTableInfo(const CXXRecordDecl *Decl, llvm::DIFile F, - llvm::SmallVectorImpl<llvm::Value *> &EltTys); + SmallVectorImpl<llvm::Value *> &EltTys); public: CGDebugInfo(CodeGenModule &CGM); @@ -234,7 +234,7 @@ private: llvm::DIDescriptor getContextDescriptor(const Decl *Decl); /// getCurrentDirname - Return current directory name. - llvm::StringRef getCurrentDirname(); + StringRef getCurrentDirname(); /// CreateCompileUnit - Create new compile unit. void CreateCompileUnit(); @@ -255,7 +255,7 @@ private: /// CreateMemberType - Create new member and increase Offset by FType's size. llvm::DIType CreateMemberType(llvm::DIFile Unit, QualType FType, - llvm::StringRef Name, uint64_t *Offset); + StringRef Name, uint64_t *Offset); /// getFunctionDeclaration - Return debug info descriptor to describe method /// declaration for the given method definition. @@ -264,21 +264,21 @@ private: /// getFunctionName - Get function name for the given FunctionDecl. If the /// name is constructred on demand (e.g. C++ destructor) then the name /// is stored on the side. - llvm::StringRef getFunctionName(const FunctionDecl *FD); + StringRef getFunctionName(const FunctionDecl *FD); /// getObjCMethodName - Returns the unmangled name of an Objective-C method. /// This is the display name for the debugging info. - llvm::StringRef getObjCMethodName(const ObjCMethodDecl *FD); + StringRef getObjCMethodName(const ObjCMethodDecl *FD); /// getSelectorName - Return selector name. This is used for debugging /// info. - llvm::StringRef getSelectorName(Selector S); + StringRef getSelectorName(Selector S); /// getClassName - Get class name including template argument list. - llvm::StringRef getClassName(RecordDecl *RD); + StringRef getClassName(RecordDecl *RD); /// getVTableName - Get vtable name for the given Class. - llvm::StringRef getVTableName(const CXXRecordDecl *Decl); + StringRef getVTableName(const CXXRecordDecl *Decl); /// getLineNumber - Get line number for the location. If location is invalid /// then use current location. diff --git a/lib/CodeGen/CGException.h b/lib/CodeGen/CGException.h index 5a743b51f6..d0216160d5 100644 --- a/lib/CodeGen/CGException.h +++ b/lib/CodeGen/CGException.h @@ -24,15 +24,15 @@ namespace CodeGen { /// The exceptions personality for a function. When class EHPersonality { - llvm::StringRef PersonalityFn; + StringRef PersonalityFn; // If this is non-null, this personality requires a non-standard // function for rethrowing an exception after a catchall cleanup. // This function must have prototype void(void*). - llvm::StringRef CatchallRethrowFn; + StringRef CatchallRethrowFn; - EHPersonality(llvm::StringRef PersonalityFn, - llvm::StringRef CatchallRethrowFn = llvm::StringRef()) + EHPersonality(StringRef PersonalityFn, + StringRef CatchallRethrowFn = StringRef()) : PersonalityFn(PersonalityFn), CatchallRethrowFn(CatchallRethrowFn) {} @@ -46,8 +46,8 @@ public: static const EHPersonality GNU_CPlusPlus; static const EHPersonality GNU_CPlusPlus_SJLJ; - llvm::StringRef getPersonalityFnName() const { return PersonalityFn; } - llvm::StringRef getCatchallRethrowFnName() const { return CatchallRethrowFn; } + StringRef getPersonalityFnName() const { return PersonalityFn; } + StringRef getCatchallRethrowFnName() const { return CatchallRethrowFn; } }; } diff --git a/lib/CodeGen/CGVTables.h b/lib/CodeGen/CGVTables.h index eff6e56c1f..8e88bba26e 100644 --- a/lib/CodeGen/CGVTables.h +++ b/lib/CodeGen/CGVTables.h @@ -116,7 +116,7 @@ class CodeGenVTables { /// pointers in the vtable for a given record decl. llvm::DenseMap<const CXXRecordDecl *, uint64_t> NumVirtualFunctionPointers; - typedef llvm::SmallVector<ThunkInfo, 1> ThunkInfoVectorTy; + typedef SmallVector<ThunkInfo, 1> ThunkInfoVectorTy; typedef llvm::DenseMap<const CXXMethodDecl *, ThunkInfoVectorTy> ThunksMapTy; /// Thunks - Contains all thunks that a given method decl will need. @@ -143,7 +143,7 @@ class CodeGenVTables { /// VTableAddressPointsMapTy - Address points for a single vtable. typedef llvm::DenseMap<BaseSubobject, uint64_t> VTableAddressPointsMapTy; - typedef llvm::SmallVector<std::pair<uint64_t, ThunkInfo>, 1> + typedef SmallVector<std::pair<uint64_t, ThunkInfo>, 1> VTableThunksTy; typedef llvm::DenseMap<const CXXRecordDecl *, VTableThunksTy> diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 1ce9c7966c..656158d77f 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -353,7 +353,7 @@ private: /// A a; /// foo: /// bar(); - llvm::SmallVector<BranchFixup, 8> BranchFixups; + SmallVector<BranchFixup, 8> BranchFixups; char *allocate(size_t Size); @@ -681,7 +681,7 @@ public: public: /// ObjCEHValueStack - Stack of Objective-C exception values, used for /// rethrows. - llvm::SmallVector<llvm::Value*, 8> ObjCEHValueStack; + SmallVector<llvm::Value*, 8> ObjCEHValueStack; /// A class controlling the emission of a finally block. class FinallyInfo { @@ -872,7 +872,7 @@ public: /// The given basic block lies in the current EH scope, but may be a /// target of a potentially scope-crossing jump; get a stable handle /// to which we can perform this jump later. - JumpDest getJumpDestInCurrentScope(llvm::StringRef Name = llvm::StringRef()) { + JumpDest getJumpDestInCurrentScope(StringRef Name = StringRef()) { return getJumpDestInCurrentScope(createBasicBlock(Name)); } @@ -1089,7 +1089,7 @@ private: JumpDest BreakBlock; JumpDest ContinueBlock; }; - llvm::SmallVector<BreakContinue, 8> BreakContinueStack; + SmallVector<BreakContinue, 8> BreakContinueStack; /// SwitchInsn - This is nearest current switch instruction. It is null if if /// current context is not in a switch. @@ -1415,7 +1415,7 @@ public: static bool hasAggregateLLVMType(QualType T); /// createBasicBlock - Create an LLVM basic block. - llvm::BasicBlock *createBasicBlock(llvm::StringRef name = "", + llvm::BasicBlock *createBasicBlock(StringRef name = "", llvm::Function *parent = 0, llvm::BasicBlock *before = 0) { #ifdef NDEBUG @@ -2122,14 +2122,14 @@ public: llvm::Value *EmitARMBuiltinExpr(unsigned BuiltinID, const CallExpr *E); llvm::Value *EmitNeonCall(llvm::Function *F, - llvm::SmallVectorImpl<llvm::Value*> &O, + SmallVectorImpl<llvm::Value*> &O, const char *name, unsigned shift = 0, bool rightshift = false); llvm::Value *EmitNeonSplat(llvm::Value *V, llvm::Constant *Idx); llvm::Value *EmitNeonShiftVector(llvm::Value *V, llvm::Type *Ty, bool negateForRightShift); - llvm::Value *BuildVector(const llvm::SmallVectorImpl<llvm::Value*> &Ops); + llvm::Value *BuildVector(const SmallVectorImpl<llvm::Value*> &Ops); llvm::Value *EmitX86BuiltinExpr(unsigned BuiltinID, const CallExpr *E); llvm::Value *EmitPPCBuiltinExpr(unsigned BuiltinID, const CallExpr *E); @@ -2370,7 +2370,7 @@ private: /// Ty, into individual arguments on the provided vector \arg Args. See /// ABIArgInfo::Expand. void ExpandTypeToArgs(QualType Ty, RValue Src, - llvm::SmallVector<llvm::Value*, 16> &Args, + SmallVector<llvm::Value*, 16> &Args, llvm::FunctionType *IRFuncTy); llvm::Value* EmitAsmInput(const AsmStmt &S, diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 76c59d42bc..e081caa7bf 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -257,7 +257,7 @@ class CodeGenModule : public CodeGenTypeCache { CtorList GlobalDtors; /// MangledDeclNames - A map of canonical GlobalDecls to their mangled names. - llvm::DenseMap<GlobalDecl, llvm::StringRef> MangledDeclNames; + llvm::DenseMap<GlobalDecl, StringRef> MangledDeclNames; llvm::BumpPtrAllocator MangledNamesAllocator; std::vector<llvm::Constant*> Annotations; @@ -279,7 +279,7 @@ class CodeGenModule : public CodeGenTypeCache { /// - Global variables with initializers whose order of initialization /// is set by init_priority attribute. - llvm::SmallVector<std::pair<OrderGlobalInits, llvm::Function*>, 8> + SmallVector<std::pair<OrderGlobalInits, llvm::Function*>, 8> PrioritizedCXXGlobalInits; /// CXXGlobalDtors - Global destructor functions and arguments that need to @@ -433,7 +433,7 @@ public: /// variable with the right type will be created and all uses of the old /// variable will be replaced with a bitcast to the new variable. llvm::GlobalVariable * - CreateOrReplaceCXXRuntimeVariable(llvm::StringRef Name, llvm::Type *Ty, + CreateOrReplaceCXXRuntimeVariable(StringRef Name, llvm::Type *Ty, llvm::GlobalValue::LinkageTypes Linkage); /// GetAddrOfGlobalVar - Return the llvm::Constant for the address of the @@ -544,7 +544,7 @@ public: /// /// \param GlobalName If provided, the name to use for the global /// (if one is created). - llvm::Constant *GetAddrOfConstantString(llvm::StringRef Str, + llvm::Constant *GetAddrOfConstantString(StringRef Str, const char *GlobalName=0); /// GetAddrOfConstantCString - Returns a pointer to a character array @@ -595,13 +595,13 @@ public: /// CreateRuntimeFunction - Create a new runtime function with the specified /// type and name. llvm::Constant *CreateRuntimeFunction(llvm::FunctionType *Ty, - llvm::StringRef Name, + StringRef Name, llvm::Attributes ExtraAttrs = llvm::Attribute::None); /// CreateRuntimeVariable - Create a new runtime global variable with the /// specified type and name. llvm::Constant *CreateRuntimeVariable(llvm::Type *Ty, - llvm::StringRef Name); + StringRef Name); ///@name Custom Blocks Runtime Interfaces ///@{ @@ -633,7 +633,7 @@ public: const AnnotateAttr *AA, unsigned LineNo); /// Error - Emit a general error that something can't be done. - void Error(SourceLocation loc, llvm::StringRef error); + void Error(SourceLocation loc, StringRef error); /// ErrorUnsupported - Print out an error that codegen doesn't support the /// specified stmt yet. @@ -688,7 +688,7 @@ public: AttributeListType &PAL, unsigned &CallingConv); - llvm::StringRef getMangledName(GlobalDecl GD); + StringRef getMangledName(GlobalDecl GD); void getBlockMangledName(GlobalDecl GD, MangleBuffer &Buffer, const BlockDecl *BD); @@ -720,15 +720,15 @@ public: std::vector<const CXXRecordDecl*> DeferredVTables; private: - llvm::GlobalValue *GetGlobalValue(llvm::StringRef Ref); + llvm::GlobalValue *GetGlobalValue(StringRef Ref); - llvm::Constant *GetOrCreateLLVMFunction(llvm::StringRef MangledName, + llvm::Constant *GetOrCreateLLVMFunction(StringRef MangledName, llvm::Type *Ty, GlobalDecl D, bool ForVTable, llvm::Attributes ExtraAttrs = llvm::Attribute::None); - llvm::Constant *GetOrCreateLLVMGlobal(llvm::StringRef MangledName, + llvm::Constant *GetOrCreateLLVMGlobal(StringRef MangledName, llvm::PointerType *PTy, const VarDecl *D, bool UnnamedAddr = false); diff --git a/lib/CodeGen/CodeGenTBAA.h b/lib/CodeGen/CodeGenTBAA.h index c4583473a0..9fe51fb331 100644 --- a/lib/CodeGen/CodeGenTBAA.h +++ b/lib/CodeGen/CodeGenTBAA.h @@ -15,7 +15,7 @@ #ifndef CLANG_CODEGEN_CODEGENTBAA_H #define CLANG_CODEGEN_CODEGENTBAA_H -#include "llvm/LLVMContext.h" +#include "clang/Basic/LLVM.h" #include "llvm/ADT/DenseMap.h" namespace llvm { @@ -55,7 +55,7 @@ class CodeGenTBAA { /// considered to be equivalent to it. llvm::MDNode *getChar(); - llvm::MDNode *getTBAAInfoForNamedType(llvm::StringRef NameStr, + llvm::MDNode *getTBAAInfoForNamedType(StringRef NameStr, llvm::MDNode *Parent, bool Readonly = false); diff --git a/lib/CodeGen/CodeGenTypes.h b/lib/CodeGen/CodeGenTypes.h index 7682f2af7d..7f0f8ac5f0 100644 --- a/lib/CodeGen/CodeGenTypes.h +++ b/lib/CodeGen/CodeGenTypes.h @@ -93,7 +93,7 @@ class CodeGenTypes { /// a recursive struct conversion, set this to true. bool SkippedLayout; - llvm::SmallVector<const RecordDecl *, 8> DeferredRecords; + SmallVector<const RecordDecl *, 8> DeferredRecords; private: /// TypeCache - This map keeps cache of llvm::Types @@ -190,7 +190,7 @@ public: /// /// \param ArgTys - must all actually be canonical as params const CGFunctionInfo &getFunctionInfo(CanQualType RetTy, - const llvm::SmallVectorImpl<CanQualType> &ArgTys, + const SmallVectorImpl<CanQualType> &ArgTys, const FunctionType::ExtInfo &Info); /// \brief Compute a new LLVM record layout object for the given record. @@ -200,7 +200,7 @@ public: /// addRecordTypeName - Compute a name from the given record decl with an /// optional suffix and name the given LLVM type using it. void addRecordTypeName(const RecordDecl *RD, llvm::StructType *Ty, - llvm::StringRef suffix); + StringRef suffix); public: // These are internal details of CGT that shouldn't be used externally. @@ -211,7 +211,7 @@ public: // These are internal details of CGT that shouldn't be used externally. /// argument types it would be passed as on the provided vector \arg /// ArgTys. See ABIArgInfo::Expand. void GetExpandedTypes(QualType type, - llvm::SmallVectorImpl<llvm::Type*> &expanded); + SmallVectorImpl<llvm::Type*> &expanded); /// IsZeroInitializable - Return whether a type can be /// zero-initialized (in the C++ sense) with an LLVM zeroinitializer. diff --git a/lib/CodeGen/TargetInfo.h b/lib/CodeGen/TargetInfo.h index d5e8884cdf..a188b9c6c2 100644 --- a/lib/CodeGen/TargetInfo.h +++ b/lib/CodeGen/TargetInfo.h @@ -15,6 +15,7 @@ #ifndef CLANG_CODEGEN_TARGETINFO_H #define CLANG_CODEGEN_TARGETINFO_H +#include "clang/Basic/LLVM.h" #include "llvm/ADT/StringRef.h" namespace llvm { @@ -107,7 +108,7 @@ namespace clang { } virtual llvm::Type* adjustInlineAsmType(CodeGen::CodeGenFunction &CGF, - llvm::StringRef Constraint, + StringRef Constraint, llvm::Type* Ty) const { return Ty; } @@ -122,7 +123,7 @@ namespace clang { /// a particular instruction sequence. This functions returns /// that instruction sequence in inline assembly, which will be /// empty if none is required. - virtual llvm::StringRef getARCRetainAutoreleasedReturnValueMarker() const { + virtual StringRef getARCRetainAutoreleasedReturnValueMarker() const { return ""; } }; diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index d68016b3a2..24545ec4b7 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -139,7 +139,7 @@ public: /// getDarwinArchName - Get the "Darwin" arch name for a particular compiler /// invocation. For example, Darwin treats different ARM variations as /// distinct architectures. - llvm::StringRef getDarwinArchName(const ArgList &Args) const; + StringRef getDarwinArchName(const ArgList &Args) const; static bool isVersionLT(unsigned (&A)[3], unsigned (&B)[3]) { for (unsigned i=0; i < 3; ++i) { diff --git a/lib/Index/EntityImpl.h b/lib/Index/EntityImpl.h index da52ccfc09..6d6a0c6d2b 100644 --- a/lib/Index/EntityImpl.h +++ b/lib/Index/EntityImpl.h @@ -47,7 +47,7 @@ public: /// \brief Get an Entity associated with the given Decl. /// \returns Null if an Entity cannot refer to this Decl. static Entity get(Decl *D, Program &Prog, ProgramImpl &ProgImpl); - static Entity get(llvm::StringRef Name, Program &Prog, ProgramImpl &ProgImpl); + static Entity get(StringRef Name, Program &Prog, ProgramImpl &ProgImpl); std::string getPrintableName(); diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index fa87217821..c75665bfc0 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -345,7 +345,7 @@ public: /// /// \returns true if an error occurred, false otherwise. bool TransformExprs(Expr **Inputs, unsigned NumInputs, bool IsCall, - llvm::SmallVectorImpl<Expr *> &Outputs, + SmallVectorImpl<Expr *> &Outputs, bool *ArgChanged = 0); /// \brief Transform the given declaration, which is referenced from a type @@ -520,8 +520,8 @@ public: bool TransformFunctionTypeParams(SourceLocation Loc, ParmVarDecl **Params, unsigned NumParams, const QualType *ParamTypes, - llvm::SmallVectorImpl<QualType> &PTypes, - llvm::SmallVectorImpl<ParmVarDecl*> *PVars); + SmallVectorImpl<QualType> &PTypes, + SmallVectorImpl<ParmVarDecl*> *PVars); /// \brief Transforms a single function-type parameter. Return null /// on error. @@ -2424,7 +2424,7 @@ template<typename Derived> bool TreeTransform<Derived>::TransformExprs(Expr **Inputs, unsigned NumInputs, bool IsCall, - llvm::SmallVectorImpl<Expr *> &Outputs, + SmallVectorImpl<Expr *> &Outputs, bool *ArgChanged) { for (unsigned I = 0; I != NumInputs; ++I) { // If requested, drop call arguments that need to be dropped. @@ -2438,7 +2438,7 @@ bool TreeTransform<Derived>::TransformExprs(Expr **Inputs, if (PackExpansionExpr *Expansion = dyn_cast<PackExpansionExpr>(Inputs[I])) { Expr *Pattern = Expansion->getPattern(); - llvm::SmallVector<UnexpandedParameterPack, 2> Unexpanded; + SmallVector<UnexpandedParameterPack, 2> Unexpanded; getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded); assert(!Unexpanded.empty() && "Pack expansion without parameter packs?"); @@ -2522,7 +2522,7 @@ TreeTransform<Derived>::TransformNestedNameSpecifierLoc( NestedNameSpecifierLoc NNS, QualType ObjectType, NamedDecl *FirstQualifierInScope) { - llvm::SmallVector<NestedNameSpecifierLoc, 4> Qualifiers; + SmallVector<NestedNameSpecifierLoc, 4> Qualifiers; for (NestedNameSpecifierLoc Qualifier = NNS; Qualifier; Qualifier = Qualifier.getPrefix()) Qualifiers.push_back(Qualifier); @@ -2887,7 +2887,7 @@ bool TreeTransform<Derived>::TransformTemplateArgument( } case TemplateArgument::Pack: { - llvm::SmallVector<TemplateArgument, 4> TransformedArgs; + SmallVector<TemplateArgument, 4> TransformedArgs; TransformedArgs.reserve(Arg.pack_size()); for (TemplateArgument::pack_iterator A = Arg.pack_begin(), AEnd = Arg.pack_end(); @@ -3016,7 +3016,7 @@ bool TreeTransform<Derived>::TransformTemplateArguments(InputIterator First, = In.getPackExpansionPattern(Ellipsis, OrigNumExpansions, getSema().Context); - llvm::SmallVector<UnexpandedParameterPack, 2> Unexpanded; + SmallVector<UnexpandedParameterPack, 2> Unexpanded; getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded); assert(!Unexpanded.empty() && "Pack expansion without parameter packs?"); @@ -3809,8 +3809,8 @@ bool TreeTransform<Derived>:: TransformFunctionTypeParams(SourceLocation Loc, ParmVarDecl **Params, unsigned NumParams, const QualType *ParamTypes, - llvm::SmallVectorImpl<QualType> &OutParamTypes, - llvm::SmallVectorImpl<ParmVarDecl*> *PVars) { + SmallVectorImpl<QualType> &OutParamTypes, + SmallVectorImpl<ParmVarDecl*> *PVars) { int indexAdjustment = 0; for (unsigned i = 0; i != NumParams; ++i) { @@ -3821,7 +3821,7 @@ bool TreeTransform<Derived>:: ParmVarDecl *NewParm = 0; if (OldParm->isParameterPack()) { // We have a function parameter pack that may need to be expanded. - llvm::SmallVector<UnexpandedParameterPack, 2> Unexpanded; + SmallVector<UnexpandedParameterPack, 2> Unexpanded; // Find the parameter packs that could be expanded. TypeLoc TL = OldParm->getTypeSourceInfo()->getTypeLoc(); @@ -3921,7 +3921,7 @@ bool TreeTransform<Derived>:: = dyn_cast<PackExpansionType>(OldType)) { // We have a function parameter pack that may need to be expanded. QualType Pattern = Expansion->getPattern(); - llvm::SmallVector<UnexpandedParameterPack, 2> Unexpanded; + SmallVector<UnexpandedParameterPack, 2> Unexpanded; getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded); // Determine whether we should expand the parameter packs. @@ -4014,8 +4014,8 @@ TreeTransform<Derived>::TransformFunctionProtoType(TypeLocBuilder &TLB, // parameters before the return type, since the return type can then refer // to the parameters themselves (via decltype, sizeof, etc.). // - llvm::SmallVector<QualType, 4> ParamTypes; - llvm::SmallVector<ParmVarDecl*, 4> ParamDecls; + SmallVector<QualType, 4> ParamTypes; + SmallVector<ParmVarDecl*, 4> ParamDecls; const FunctionProtoType *T = TL.getTypePtr(); QualType ResultType; @@ -5256,7 +5256,7 @@ template<typename Derived> StmtResult TreeTransform<Derived>::TransformDeclStmt(DeclStmt *S) { bool DeclChanged = false; - llvm::SmallVector<Decl *, 4> Decls; + SmallVector<Decl *, 4> Decls; for (DeclStmt::decl_iterator D = S->decl_begin(), DEnd = S->decl_end(); D != DEnd; ++D) { Decl *Transformed = getDerived().TransformDefinition((*D)->getLocation(), @@ -5283,7 +5283,7 @@ TreeTransform<Derived>::TransformAsmStmt(AsmStmt *S) { ASTOwningVector<Expr*> Constraints(getSema()); ASTOwningVector<Expr*> Exprs(getSema()); - llvm::SmallVector<IdentifierInfo *, 4> Names; + SmallVector<IdentifierInfo *, 4> Names; ExprResult AsmString; ASTOwningVector<Expr*> Clobbers(getSema()); @@ -5813,8 +5813,8 @@ TreeTransform<Derived>::TransformGenericSelectionExpr(GenericSelectionExpr *E) { if (ControllingExpr.isInvalid()) return ExprError(); - llvm::SmallVector<Expr *, 4> AssocExprs; - llvm::SmallVector<TypeSourceInfo *, 4> AssocTypes; + SmallVector<Expr *, 4> AssocExprs; + SmallVector<TypeSourceInfo *, 4> AssocTypes; for (unsigned i = 0; i != E->getNumAssocs(); ++i) { TypeSourceInfo *TS = E->getAssocTypeSourceInfo(i); if (TS) { @@ -5887,7 +5887,7 @@ TreeTransform<Derived>::TransformOffsetOfExpr(OffsetOfExpr *E) { bool ExprChanged = false; typedef Sema::OffsetOfComponent Component; typedef OffsetOfExpr::OffsetOfNode Node; - llvm::SmallVector<Component, 4> Components; + SmallVector<Component, 4> Components; for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) { const Node &ON = E->getComponent(I); Component Comp; @@ -7908,8 +7908,8 @@ TreeTransform<Derived>::TransformBlockExpr(BlockExpr *E) { // expression. blockScope->CapturesCXXThis = oldBlock->capturesCXXThis(); - llvm::SmallVector<ParmVarDecl*, 4> params; - llvm::SmallVector<QualType, 4> paramTypes; + SmallVector<ParmVarDecl*, 4> params; + SmallVector<QualType, 4> paramTypes; // Parameter substitution. if (getDerived().TransformFunctionTypeParams(E->getCaretLocation(), |