diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-23 10:55:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-23 10:55:15 +0000 |
commit | 5f9e272e632e951b1efe824cd16acb4d96077930 (patch) | |
tree | 3268557d12b85d0c2e72de5329ec83d4fc0bca48 /lib/CodeGen | |
parent | d47d3b0cfeb7e8564ff77f48130fe63282b6d127 (diff) |
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
33 files changed, 338 insertions, 339 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 9544cb4eb7..8edf2eda06 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -62,7 +62,7 @@ static llvm::Constant *buildBlockDescriptor(CodeGenModule &CGM, llvm::Type *ulong = CGM.getTypes().ConvertType(C.UnsignedLongTy); llvm::Type *i8p = CGM.getTypes().ConvertType(C.VoidPtrTy); - llvm::SmallVector<llvm::Constant*, 6> elements; + SmallVector<llvm::Constant*, 6> elements; // reserved elements.push_back(llvm::ConstantInt::get(ulong, 0)); @@ -243,7 +243,7 @@ static CharUnits getLowBit(CharUnits v) { } static void initializeForBlockHeader(CodeGenModule &CGM, CGBlockInfo &info, - llvm::SmallVectorImpl<llvm::Type*> &elementTypes) { + SmallVectorImpl<llvm::Type*> &elementTypes) { ASTContext &C = CGM.getContext(); // The header is basically a 'struct { void *; int; int; void *; void *; }'. @@ -280,7 +280,7 @@ static void computeBlockInfo(CodeGenModule &CGM, CGBlockInfo &info) { ASTContext &C = CGM.getContext(); const BlockDecl *block = info.getBlockDecl(); - llvm::SmallVector<llvm::Type*, 8> elementTypes; + SmallVector<llvm::Type*, 8> elementTypes; initializeForBlockHeader(CGM, info, elementTypes); if (!block->hasCaptures()) { @@ -291,7 +291,7 @@ static void computeBlockInfo(CodeGenModule &CGM, CGBlockInfo &info) { } // Collect the layout chunks. - llvm::SmallVector<BlockLayoutChunk, 16> layout; + SmallVector<BlockLayoutChunk, 16> layout; layout.reserve(block->capturesCXXThis() + (block->capture_end() - block->capture_begin())); @@ -422,7 +422,7 @@ static void computeBlockInfo(CodeGenModule &CGM, CGBlockInfo &info) { // which has 7 bytes of padding, as opposed to the naive solution // which might have less (?). if (endAlign < maxFieldAlign) { - llvm::SmallVectorImpl<BlockLayoutChunk>::iterator + SmallVectorImpl<BlockLayoutChunk>::iterator li = layout.begin() + 1, le = layout.end(); // Look for something that the header end is already @@ -433,7 +433,7 @@ static void computeBlockInfo(CodeGenModule &CGM, CGBlockInfo &info) { // If we found something that's naturally aligned for the end of // the header, keep adding things... if (li != le) { - llvm::SmallVectorImpl<BlockLayoutChunk>::iterator first = li; + SmallVectorImpl<BlockLayoutChunk>::iterator first = li; for (; li != le; ++li) { assert(endAlign >= li->Alignment); @@ -468,7 +468,7 @@ static void computeBlockInfo(CodeGenModule &CGM, CGBlockInfo &info) { // Slam everything else on now. This works because they have // strictly decreasing alignment and we expect that size is always a // multiple of alignment. - for (llvm::SmallVectorImpl<BlockLayoutChunk>::iterator + for (SmallVectorImpl<BlockLayoutChunk>::iterator li = layout.begin(), le = layout.end(); li != le; ++li) { assert(endAlign >= li->Alignment); li->setIndex(info, elementTypes.size()); @@ -1665,7 +1665,7 @@ llvm::Type *CodeGenFunction::BuildByRefType(const VarDecl *D) { QualType Ty = D->getType(); - llvm::SmallVector<llvm::Type *, 8> types; + SmallVector<llvm::Type *, 8> types; llvm::StructType *ByRefType = llvm::StructType::createNamed(getLLVMContext(), diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index dedac9da0a..5c49d5945c 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -1193,12 +1193,12 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID, const FunctionDecl *FD = E->getDirectCallee(); // Oddly people write this call without args on occasion and gcc accepts // it - it's also marked as varargs in the description file. - llvm::SmallVector<Value*, 2> Ops; + SmallVector<Value*, 2> Ops; for (unsigned i = 0; i < E->getNumArgs(); i++) Ops.push_back(EmitScalarExpr(E->getArg(i))); llvm::Type *Ty = CGM.getTypes().ConvertType(FD->getType()); llvm::FunctionType *FTy = cast<llvm::FunctionType>(Ty); - llvm::StringRef Name = FD->getName(); + StringRef Name = FD->getName(); return Builder.CreateCall(CGM.CreateRuntimeFunction(FTy, Name), Ops); } @@ -1236,7 +1236,7 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID, return Builder.CreateCall3(F, Arg0, Arg1, StPtr, "strexd"); } - llvm::SmallVector<Value*, 4> Ops; + SmallVector<Value*, 4> Ops; for (unsigned i = 0, e = E->getNumArgs() - 1; i != e; i++) Ops.push_back(EmitScalarExpr(E->getArg(i))); @@ -1918,7 +1918,7 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID, } llvm::Value *CodeGenFunction:: -BuildVector(const llvm::SmallVectorImpl<llvm::Value*> &Ops) { +BuildVector(const SmallVectorImpl<llvm::Value*> &Ops) { assert((Ops.size() & (Ops.size() - 1)) == 0 && "Not a power-of-two sized vector!"); bool AllConstants = true; @@ -1946,7 +1946,7 @@ BuildVector(const llvm::SmallVectorImpl<llvm::Value*> &Ops) { Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID, const CallExpr *E) { - llvm::SmallVector<Value*, 4> Ops; + SmallVector<Value*, 4> Ops; // Find out if any arguments are required to be integer constant expressions. unsigned ICEArguments = 0; @@ -2141,7 +2141,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID, // If palignr is shifting the pair of input vectors less than 9 bytes, // emit a shuffle instruction. if (shiftVal <= 8) { - llvm::SmallVector<llvm::Constant*, 8> Indices; + SmallVector<llvm::Constant*, 8> Indices; for (unsigned i = 0; i != 8; ++i) Indices.push_back(llvm::ConstantInt::get(Int32Ty, shiftVal + i)); @@ -2172,7 +2172,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID, // If palignr is shifting the pair of input vectors less than 17 bytes, // emit a shuffle instruction. if (shiftVal <= 16) { - llvm::SmallVector<llvm::Constant*, 16> Indices; + SmallVector<llvm::Constant*, 16> Indices; for (unsigned i = 0; i != 16; ++i) Indices.push_back(llvm::ConstantInt::get(Int32Ty, shiftVal + i)); @@ -2349,7 +2349,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID, Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID, const CallExpr *E) { - llvm::SmallVector<Value*, 4> Ops; + SmallVector<Value*, 4> Ops; for (unsigned i = 0, e = E->getNumArgs(); i != e; i++) Ops.push_back(EmitScalarExpr(E->getArg(i))); diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index f841b25009..f7f8a1271c 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -154,7 +154,7 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl, new llvm::GlobalAlias(AliasType, Linkage, "", Aliasee, &getModule()); // Switch any previous uses to the alias. - llvm::StringRef MangledName = getMangledName(AliasDecl); + StringRef MangledName = getMangledName(AliasDecl); llvm::GlobalValue *Entry = GetGlobalValue(MangledName); if (Entry) { assert(Entry->isDeclaration() && "definition already exists for alias"); @@ -214,7 +214,7 @@ CodeGenModule::GetAddrOfCXXConstructor(const CXXConstructorDecl *ctor, const CGFunctionInfo *fnInfo) { GlobalDecl GD(ctor, ctorType); - llvm::StringRef name = getMangledName(GD); + StringRef name = getMangledName(GD); if (llvm::GlobalValue *existing = GetGlobalValue(name)) return existing; @@ -282,7 +282,7 @@ CodeGenModule::GetAddrOfCXXDestructor(const CXXDestructorDecl *dtor, const CGFunctionInfo *fnInfo) { GlobalDecl GD(dtor, dtorType); - llvm::StringRef name = getMangledName(GD); + StringRef name = getMangledName(GD); if (llvm::GlobalValue *existing = GetGlobalValue(name)) return existing; diff --git a/lib/CodeGen/CGCXXABI.cpp b/lib/CodeGen/CGCXXABI.cpp index ff7213df1f..8106507e0d 100644 --- a/lib/CodeGen/CGCXXABI.cpp +++ b/lib/CodeGen/CGCXXABI.cpp @@ -20,7 +20,7 @@ using namespace CodeGen; CGCXXABI::~CGCXXABI() { } static void ErrorUnsupportedABI(CodeGenFunction &CGF, - llvm::StringRef S) { + StringRef S) { Diagnostic &Diags = CGF.CGM.getDiags(); unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error, "cannot yet compile %1 in this ABI"); diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index e3b93a3f45..d13fd017cd 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -69,14 +69,14 @@ static CanQualType GetReturnType(QualType RetTy) { const CGFunctionInfo & CodeGenTypes::getFunctionInfo(CanQual<FunctionNoProtoType> FTNP) { return getFunctionInfo(FTNP->getResultType().getUnqualifiedType(), - llvm::SmallVector<CanQualType, 16>(), + SmallVector<CanQualType, 16>(), FTNP->getExtInfo()); } /// \param Args - contains any initial parameters besides those /// in the formal type static const CGFunctionInfo &getFunctionInfo(CodeGenTypes &CGT, - llvm::SmallVectorImpl<CanQualType> &ArgTys, + SmallVectorImpl<CanQualType> &ArgTys, CanQual<FunctionProtoType> FTP) { // FIXME: Kill copy. for (unsigned i = 0, e = FTP->getNumArgs(); i != e; ++i) @@ -87,7 +87,7 @@ static const CGFunctionInfo &getFunctionInfo(CodeGenTypes &CGT, const CGFunctionInfo & CodeGenTypes::getFunctionInfo(CanQual<FunctionProtoType> FTP) { - llvm::SmallVector<CanQualType, 16> ArgTys; + SmallVector<CanQualType, 16> ArgTys; return ::getFunctionInfo(*this, ArgTys, FTP); } @@ -113,7 +113,7 @@ static CallingConv getCallingConventionForDecl(const Decl *D) { const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXRecordDecl *RD, const FunctionProtoType *FTP) { - llvm::SmallVector<CanQualType, 16> ArgTys; + SmallVector<CanQualType, 16> ArgTys; // Add the 'this' pointer. ArgTys.push_back(GetThisType(Context, RD)); @@ -123,7 +123,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXRecordDecl *RD, } const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXMethodDecl *MD) { - llvm::SmallVector<CanQualType, 16> ArgTys; + SmallVector<CanQualType, 16> ArgTys; assert(!isa<CXXConstructorDecl>(MD) && "wrong method for contructors!"); assert(!isa<CXXDestructorDecl>(MD) && "wrong method for destructors!"); @@ -137,7 +137,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXMethodDecl *MD) { const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXConstructorDecl *D, CXXCtorType Type) { - llvm::SmallVector<CanQualType, 16> ArgTys; + SmallVector<CanQualType, 16> ArgTys; ArgTys.push_back(GetThisType(Context, D->getParent())); CanQualType ResTy = Context.VoidTy; @@ -154,7 +154,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXConstructorDecl *D, const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXDestructorDecl *D, CXXDtorType Type) { - llvm::SmallVector<CanQualType, 2> ArgTys; + SmallVector<CanQualType, 2> ArgTys; ArgTys.push_back(GetThisType(Context, D->getParent())); CanQualType ResTy = Context.VoidTy; @@ -180,7 +180,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const FunctionDecl *FD) { } const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const ObjCMethodDecl *MD) { - llvm::SmallVector<CanQualType, 16> ArgTys; + SmallVector<CanQualType, 16> ArgTys; ArgTys.push_back(Context.getCanonicalParamType(MD->getSelfDecl()->getType())); ArgTys.push_back(Context.getCanonicalParamType(Context.getObjCSelType())); // FIXME: Kill copy? @@ -216,7 +216,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(QualType ResTy, const CallArgList &Args, const FunctionType::ExtInfo &Info) { // FIXME: Kill copy. - llvm::SmallVector<CanQualType, 16> ArgTys; + SmallVector<CanQualType, 16> ArgTys; for (CallArgList::const_iterator i = Args.begin(), e = Args.end(); i != e; ++i) ArgTys.push_back(Context.getCanonicalParamType(i->Ty)); @@ -227,7 +227,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(QualType ResTy, const FunctionArgList &Args, const FunctionType::ExtInfo &Info) { // FIXME: Kill copy. - llvm::SmallVector<CanQualType, 16> ArgTys; + SmallVector<CanQualType, 16> ArgTys; for (FunctionArgList::const_iterator i = Args.begin(), e = Args.end(); i != e; ++i) ArgTys.push_back(Context.getCanonicalParamType((*i)->getType())); @@ -235,15 +235,15 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(QualType ResTy, } const CGFunctionInfo &CodeGenTypes::getNullaryFunctionInfo() { - llvm::SmallVector<CanQualType, 1> args; + SmallVector<CanQualType, 1> args; return getFunctionInfo(getContext().VoidTy, args, FunctionType::ExtInfo()); } const CGFunctionInfo &CodeGenTypes::getFunctionInfo(CanQualType ResTy, - const llvm::SmallVectorImpl<CanQualType> &ArgTys, + const SmallVectorImpl<CanQualType> &ArgTys, const FunctionType::ExtInfo &Info) { #ifndef NDEBUG - for (llvm::SmallVectorImpl<CanQualType>::const_iterator + for (SmallVectorImpl<CanQualType>::const_iterator I = ArgTys.begin(), E = ArgTys.end(); I != E; ++I) assert(I->isCanonicalAsParam()); #endif @@ -312,7 +312,7 @@ CGFunctionInfo::CGFunctionInfo(unsigned _CallingConvention, /***/ void CodeGenTypes::GetExpandedTypes(QualType type, - llvm::SmallVectorImpl<llvm::Type*> &expandedTypes) { + SmallVectorImpl<llvm::Type*> &expandedTypes) { const RecordType *RT = type->getAsStructureType(); assert(RT && "Can only expand structure types."); const RecordDecl *RD = RT->getDecl(); @@ -614,7 +614,7 @@ CodeGenTypes::GetFunctionType(const CGFunctionInfo &FI, bool isVariadic) { bool Inserted = FunctionsBeingProcessed.insert(&FI); (void)Inserted; assert(Inserted && "Recursively being processed?"); - llvm::SmallVector<llvm::Type*, 8> argTypes; + SmallVector<llvm::Type*, 8> argTypes; llvm::Type *resultType = 0; const ABIArgInfo &retAI = FI.getReturnInfo(); @@ -824,7 +824,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, continue; case ABIArgInfo::Expand: { - llvm::SmallVector<llvm::Type*, 8> types; + SmallVector<llvm::Type*, 8> types; // FIXME: This is rather inefficient. Do we ever actually need to do // anything here? The result should be just reconstructed on the other // side, so extension should be a non-issue. @@ -995,7 +995,7 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI, for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) { assert(AI != Fn->arg_end() && "Argument mismatch!"); - AI->setName(Arg->getName() + ".coerce" + llvm::Twine(i)); + AI->setName(Arg->getName() + ".coerce" + Twine(i)); llvm::Value *EltPtr = Builder.CreateConstGEP2_32(Ptr, 0, i); Builder.CreateStore(AI++, EltPtr); } @@ -1029,7 +1029,7 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI, // Name the arguments used in expansion and increment AI. unsigned Index = 0; for (; AI != End; ++AI, ++Index) - AI->setName(Arg->getName() + "." + llvm::Twine(Index)); + AI->setName(Arg->getName() + "." + Twine(Index)); continue; } @@ -1063,7 +1063,7 @@ static llvm::Value *tryEmitFusedAutoreleaseOfResult(CodeGenFunction &CGF, // result is in a BasicBlock and is therefore an Instruction. llvm::Instruction *generator = cast<llvm::Instruction>(result); - llvm::SmallVector<llvm::Instruction*,4> insnsToKill; + SmallVector<llvm::Instruction*,4> insnsToKill; // Look for: // %generator = bitcast %type1* %generator2 to %type2* @@ -1116,7 +1116,7 @@ static llvm::Value *tryEmitFusedAutoreleaseOfResult(CodeGenFunction &CGF, } // Delete all the unnecessary instructions, from latest to earliest. - for (llvm::SmallVectorImpl<llvm::Instruction*>::iterator + for (SmallVectorImpl<llvm::Instruction*>::iterator i = insnsToKill.begin(), e = insnsToKill.end(); i != e; ++i) (*i)->eraseFromParent(); @@ -1432,7 +1432,7 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, llvm::CallSite CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee, llvm::ArrayRef<llvm::Value *> Args, - const llvm::Twine &Name) { + const Twine &Name) { llvm::BasicBlock *InvokeDest = getInvokeDest(); if (!InvokeDest) return Builder.CreateCall(Callee, Args, Name); @@ -1446,7 +1446,7 @@ CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee, llvm::CallSite CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee, - const llvm::Twine &Name) { + const Twine &Name) { return EmitCallOrInvoke(Callee, llvm::ArrayRef<llvm::Value *>(), Name); } @@ -1460,7 +1460,7 @@ static void checkArgMatches(llvm::Value *Elt, unsigned &ArgNo, } void CodeGenFunction::ExpandTypeToArgs(QualType Ty, RValue RV, - llvm::SmallVector<llvm::Value*,16> &Args, + SmallVector<llvm::Value*,16> &Args, llvm::FunctionType *IRFuncTy) { const RecordType *RT = Ty->getAsStructureType(); assert(RT && "Can only expand structure types."); @@ -1503,7 +1503,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, const Decl *TargetDecl, llvm::Instruction **callOrInvoke) { // FIXME: We no longer need the types from CallArgs; lift up and simplify. - llvm::SmallVector<llvm::Value*, 16> Args; + SmallVector<llvm::Value*, 16> Args; // Handle struct-return functions by passing a pointer to the // location that we would like to return into. diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index d2b104eec0..2d32b83b12 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -729,7 +729,7 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD, const CXXRecordDecl *ClassDecl = CD->getParent(); - llvm::SmallVector<CXXCtorInitializer *, 8> MemberInitializers; + SmallVector<CXXCtorInitializer *, 8> MemberInitializers; for (CXXConstructorDecl::init_const_iterator B = CD->init_begin(), E = CD->init_end(); @@ -1018,7 +1018,7 @@ void CodeGenFunction::EnterDtorCleanups(const CXXDestructorDecl *DD, } // Destroy direct fields. - llvm::SmallVector<const FieldDecl *, 16> FieldDecls; + SmallVector<const FieldDecl *, 16> FieldDecls; for (CXXRecordDecl::field_iterator I = ClassDecl->field_begin(), E = ClassDecl->field_end(); I != E; ++I) { const FieldDecl *field = *I; diff --git a/lib/CodeGen/CGCleanup.cpp b/lib/CodeGen/CGCleanup.cpp index 564b662638..10f716aa95 100644 --- a/lib/CodeGen/CGCleanup.cpp +++ b/lib/CodeGen/CGCleanup.cpp @@ -583,7 +583,7 @@ void CodeGenFunction::PopCleanupBlock(bool FallthroughIsBranchThrough) { // Copy the cleanup emission data out. Note that SmallVector // guarantees maximal alignment for its buffer regardless of its // type parameter. - llvm::SmallVector<char, 8*sizeof(void*)> CleanupBuffer; + SmallVector<char, 8*sizeof(void*)> CleanupBuffer; CleanupBuffer.reserve(Scope.getCleanupSize()); memcpy(CleanupBuffer.data(), Scope.getCleanupBuffer(), Scope.getCleanupSize()); @@ -595,7 +595,7 @@ void CodeGenFunction::PopCleanupBlock(bool FallthroughIsBranchThrough) { // ahead and do the setup for the EH cleanup while the scope is still // alive. llvm::BasicBlock *EHEntry = 0; - llvm::SmallVector<llvm::Instruction*, 2> EHInstsToAppend; + SmallVector<llvm::Instruction*, 2> EHInstsToAppend; if (RequiresEHCleanup) { EHEntry = CreateEHEntry(*this, Scope); @@ -716,7 +716,7 @@ void CodeGenFunction::PopCleanupBlock(bool FallthroughIsBranchThrough) { } llvm::BasicBlock *FallthroughDest = 0; - llvm::SmallVector<llvm::Instruction*, 2> InstsToAppend; + SmallVector<llvm::Instruction*, 2> InstsToAppend; // If there's exactly one branch-after and no other threads, // we can route it without a switch. diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 3c9b3eb78f..9cfb71e825 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -81,7 +81,7 @@ llvm::DIDescriptor CGDebugInfo::getContextDescriptor(const Decl *Context) { /// 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 CGDebugInfo::getFunctionName(const FunctionDecl *FD) { +StringRef CGDebugInfo::getFunctionName(const FunctionDecl *FD) { assert (FD && "Invalid FunctionDecl!"); IdentifierInfo *FII = FD->getIdentifier(); if (FII) @@ -93,10 +93,10 @@ llvm::StringRef CGDebugInfo::getFunctionName(const FunctionDecl *FD) { // Copy this name on the side and use its reference. char *StrPtr = DebugInfoNames.Allocate<char>(NS.length()); memcpy(StrPtr, NS.data(), NS.length()); - return llvm::StringRef(StrPtr, NS.length()); + return StringRef(StrPtr, NS.length()); } -llvm::StringRef CGDebugInfo::getObjCMethodName(const ObjCMethodDecl *OMD) { +StringRef CGDebugInfo::getObjCMethodName(const ObjCMethodDecl *OMD) { llvm::SmallString<256> MethodName; llvm::raw_svector_ostream OS(MethodName); OS << (OMD->isInstanceMethod() ? '-' : '+') << '['; @@ -116,22 +116,22 @@ llvm::StringRef CGDebugInfo::getObjCMethodName(const ObjCMethodDecl *OMD) { char *StrPtr = DebugInfoNames.Allocate<char>(OS.tell()); memcpy(StrPtr, MethodName.begin(), OS.tell()); - return llvm::StringRef(StrPtr, OS.tell()); + return StringRef(StrPtr, OS.tell()); } /// getSelectorName - Return selector name. This is used for debugging /// info. -llvm::StringRef CGDebugInfo::getSelectorName(Selector S) { +StringRef CGDebugInfo::getSelectorName(Selector S) { llvm::SmallString<256> SName; llvm::raw_svector_ostream OS(SName); OS << S.getAsString(); char *StrPtr = DebugInfoNames.Allocate<char>(OS.tell()); memcpy(StrPtr, SName.begin(), OS.tell()); - return llvm::StringRef(StrPtr, OS.tell()); + return StringRef(StrPtr, OS.tell()); } /// getClassName - Get class name including template argument list. -llvm::StringRef +StringRef CGDebugInfo::getClassName(RecordDecl *RD) { ClassTemplateSpecializationDecl *Spec = dyn_cast<ClassTemplateSpecializationDecl>(RD); @@ -160,7 +160,7 @@ CGDebugInfo::getClassName(RecordDecl *RD) { // Copy this name on the side and use its reference. char *StrPtr = DebugInfoNames.Allocate<char>(Buffer.length()); memcpy(StrPtr, Buffer.data(), Buffer.length()); - return llvm::StringRef(StrPtr, Buffer.length()); + return StringRef(StrPtr, Buffer.length()); } /// getOrCreateFile - Get the file debug info descriptor for the input location. @@ -172,7 +172,7 @@ llvm::DIFile CGDebugInfo::getOrCreateFile(SourceLocation Loc) { SourceManager &SM = CGM.getContext().getSourceManager(); PresumedLoc PLoc = SM.getPresumedLoc(Loc); - if (PLoc.isInvalid() || llvm::StringRef(PLoc.getFilename()).empty()) + if (PLoc.isInvalid() || StringRef(PLoc.getFilename()).empty()) // If the location is not valid then use main input file. return DBuilder.createFile(TheCU.getFilename(), TheCU.getDirectory()); @@ -217,14 +217,14 @@ unsigned CGDebugInfo::getColumnNumber(SourceLocation Loc) { return PLoc.isValid()? PLoc.getColumn() : 0; } -llvm::StringRef CGDebugInfo::getCurrentDirname() { +StringRef CGDebugInfo::getCurrentDirname() { if (!CWDName.empty()) return CWDName; char *CompDirnamePtr = NULL; llvm::sys::Path CWD = llvm::sys::Path::GetCurrentDirectory(); CompDirnamePtr = DebugInfoNames.Allocate<char>(CWD.size()); memcpy(CompDirnamePtr, CWD.c_str(), CWD.size()); - return CWDName = llvm::StringRef(CompDirnamePtr, CWD.size()); + return CWDName = StringRef(CompDirnamePtr, CWD.size()); } /// CreateCompileUnit - Create new compile unit. @@ -250,7 +250,7 @@ void CGDebugInfo::CreateCompileUnit() { // Save filename string. char *FilenamePtr = DebugInfoNames.Allocate<char>(MainFileName.length()); memcpy(FilenamePtr, MainFileName.c_str(), MainFileName.length()); - llvm::StringRef Filename(FilenamePtr, MainFileName.length()); + StringRef Filename(FilenamePtr, MainFileName.length()); unsigned LangTag; const LangOptions &LO = CGM.getLangOptions(); @@ -312,7 +312,7 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) { llvm::DIType ISATy = DBuilder.createPointerType(OCTy, Size); - llvm::SmallVector<llvm::Value *, 16> EltTys; + SmallVector<llvm::Value *, 16> EltTys; llvm::DIType FieldTy = DBuilder.createMemberType(getOrCreateMainFile(), "isa", getOrCreateMainFile(), 0, Size, @@ -489,7 +489,7 @@ llvm::DIType CGDebugInfo::CreateType(const BlockPointerType *Ty, if (BlockLiteralGenericSet) return BlockLiteralGeneric; - llvm::SmallVector<llvm::Value *, 8> EltTys; + SmallVector<llvm::Value *, 8> EltTys; llvm::DIType FieldTy; QualType FType; uint64_t FieldSize, FieldOffset; @@ -567,7 +567,7 @@ llvm::DIType CGDebugInfo::CreateType(const TypedefType *Ty, llvm::DIType CGDebugInfo::CreateType(const FunctionType *Ty, llvm::DIFile Unit) { - llvm::SmallVector<llvm::Value *, 16> EltTys; + SmallVector<llvm::Value *, 16> EltTys; // Add the result type at least. EltTys.push_back(getOrCreateType(Ty->getResultType(), Unit)); @@ -587,7 +587,7 @@ llvm::DIType CGDebugInfo::CreateType(const FunctionType *Ty, return DbgTy; } -llvm::DIType CGDebugInfo::createFieldType(llvm::StringRef name, +llvm::DIType CGDebugInfo::createFieldType(StringRef name, QualType type, Expr *bitWidth, SourceLocation loc, @@ -624,7 +624,7 @@ llvm::DIType CGDebugInfo::createFieldType(llvm::StringRef name, /// record fields. This is used while creating debug info entry for a Record. void CGDebugInfo:: CollectRecordFields(const RecordDecl *record, llvm::DIFile tunit, - llvm::SmallVectorImpl<llvm::Value *> &elements, + SmallVectorImpl<llvm::Value *> &elements, llvm::DIType RecordTy) { unsigned fieldNo = 0; const FieldDecl *LastFD = 0; @@ -644,7 +644,7 @@ CollectRecordFields(const RecordDecl *record, llvm::DIFile tunit, LastFD = field; } - llvm::StringRef name = field->getName(); + StringRef name = field->getName(); QualType type = field->getType(); // Ignore unnamed fields unless they're anonymous structs/unions. @@ -678,7 +678,7 @@ CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method, llvm::DIArray Args = llvm::DICompositeType(FnTy).getTypeArray(); assert (Args.getNumElements() && "Invalid number of arguments!"); - llvm::SmallVector<llvm::Value *, 16> Elts; + SmallVector<llvm:: |