r235412 - DebugInfo: Prepare for removal of DIArray and DITypeArray typedefs
Duncan P. N. Exon Smith
dexonsmith at apple.com
Tue Apr 21 13:07:30 PDT 2015
Author: dexonsmith
Date: Tue Apr 21 15:07:29 2015
New Revision: 235412
URL: http://llvm.org/viewvc/llvm-project?rev=235412&view=rev
Log:
DebugInfo: Prepare for removal of DIArray and DITypeArray typedefs
An upcoming LLVM commit will remove the `DIArray` and `DITypeArray`
typedefs that shadow `DebugNodeArray` and `MDTypeRefArray`,
respectively. Use those types directly.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.h
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=235412&r1=235411&r2=235412&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Apr 21 15:07:29 2015
@@ -423,7 +423,7 @@ llvm::MDType *CGDebugInfo::CreateType(co
ObjTy =
DBuilder.createStructType(TheCU, "objc_object", getOrCreateMainFile(),
- 0, 0, 0, 0, nullptr, llvm::DIArray());
+ 0, 0, 0, 0, nullptr, llvm::DebugNodeArray());
DBuilder.replaceArrays(
ObjTy,
@@ -698,7 +698,7 @@ llvm::MDType *CGDebugInfo::CreateType(co
QualType FType;
uint64_t FieldSize, FieldOffset;
unsigned FieldAlign;
- llvm::DIArray Elements;
+ llvm::DebugNodeArray Elements;
FieldOffset = 0;
FType = CGM.getContext().UnsignedLongTy;
@@ -801,7 +801,7 @@ llvm::MDType *CGDebugInfo::CreateType(co
EltTys.push_back(DBuilder.createUnspecifiedParameter());
}
- llvm::DITypeArray EltTypeArray = DBuilder.getOrCreateTypeArray(EltTys);
+ llvm::MDTypeRefArray EltTypeArray = DBuilder.getOrCreateTypeArray(EltTys);
return DBuilder.createSubroutineType(Unit, EltTypeArray);
}
@@ -1014,7 +1014,7 @@ CGDebugInfo::getOrCreateMethodType(const
llvm::MDSubroutineType *CGDebugInfo::getOrCreateInstanceMethodType(
QualType ThisPtr, const FunctionProtoType *Func, llvm::MDFile *Unit) {
// Add "this" pointer.
- llvm::DITypeArray Args(
+ llvm::MDTypeRefArray Args(
cast<llvm::MDSubroutineType>(getOrCreateType(QualType(Func, 0), Unit))
->getTypeArray());
assert(Args.size() && "Invalid number of arguments!");
@@ -1053,7 +1053,7 @@ llvm::MDSubroutineType *CGDebugInfo::get
for (unsigned i = 1, e = Args.size(); i != e; ++i)
Elts.push_back(Args[i]);
- llvm::DITypeArray EltTypeArray = DBuilder.getOrCreateTypeArray(Elts);
+ llvm::MDTypeRefArray EltTypeArray = DBuilder.getOrCreateTypeArray(Elts);
unsigned Flags = 0;
if (Func->getExtProtoInfo().RefQualifier == RQ_LValue)
@@ -1139,7 +1139,8 @@ llvm::MDSubprogram *CGDebugInfo::CreateC
if (Method->getRefQualifier() == RQ_RValue)
Flags |= llvm::DebugNode::FlagRValueReference;
- llvm::DIArray TParamsArray = CollectFunctionTemplateParams(Method, Unit);
+ llvm::DebugNodeArray TParamsArray =
+ CollectFunctionTemplateParams(Method, Unit);
llvm::MDSubprogram *SP = DBuilder.createMethod(
RecordTy, MethodName, MethodLinkageName, MethodDefUnit, MethodLine,
MethodTy, /*isLocalToUnit=*/false,
@@ -1232,7 +1233,7 @@ void CGDebugInfo::CollectCXXBases(const
}
/// CollectTemplateParams - A helper function to collect template parameters.
-llvm::DIArray
+llvm::DebugNodeArray
CGDebugInfo::CollectTemplateParams(const TemplateParameterList *TPList,
ArrayRef<TemplateArgument> TAList,
llvm::MDFile *Unit) {
@@ -1338,8 +1339,9 @@ CGDebugInfo::CollectTemplateParams(const
/// CollectFunctionTemplateParams - A helper function to collect debug
/// info for function template parameters.
-llvm::DIArray CGDebugInfo::CollectFunctionTemplateParams(const FunctionDecl *FD,
- llvm::MDFile *Unit) {
+llvm::DebugNodeArray
+CGDebugInfo::CollectFunctionTemplateParams(const FunctionDecl *FD,
+ llvm::MDFile *Unit) {
if (FD->getTemplatedKind() ==
FunctionDecl::TK_FunctionTemplateSpecialization) {
const TemplateParameterList *TList = FD->getTemplateSpecializationInfo()
@@ -1348,12 +1350,12 @@ llvm::DIArray CGDebugInfo::CollectFuncti
return CollectTemplateParams(
TList, FD->getTemplateSpecializationArgs()->asArray(), Unit);
}
- return llvm::DIArray();
+ return llvm::DebugNodeArray();
}
/// CollectCXXTemplateParams - A helper function to collect debug info for
/// template parameters.
-llvm::DIArray CGDebugInfo::CollectCXXTemplateParams(
+llvm::DebugNodeArray CGDebugInfo::CollectCXXTemplateParams(
const ClassTemplateSpecializationDecl *TSpecial, llvm::MDFile *Unit) {
// Always get the full list of parameters, not just the ones from
// the specialization.
@@ -1372,7 +1374,7 @@ llvm::MDType *CGDebugInfo::getOrCreateVT
/* Function type */
llvm::Metadata *STy = getOrCreateType(Context.IntTy, Unit);
- llvm::DITypeArray SElements = DBuilder.getOrCreateTypeArray(STy);
+ llvm::MDTypeRefArray SElements = DBuilder.getOrCreateTypeArray(STy);
llvm::MDType *SubTy = DBuilder.createSubroutineType(Unit, SElements);
unsigned Size = Context.getTypeSize(Context.VoidPtrTy);
llvm::MDType *vtbl_ptr_type =
@@ -1578,7 +1580,7 @@ llvm::MDType *CGDebugInfo::CreateTypeDef
LexicalBlockStack.pop_back();
RegionMap.erase(Ty->getDecl());
- llvm::DIArray Elements = DBuilder.getOrCreateArray(EltTys);
+ llvm::DebugNodeArray Elements = DBuilder.getOrCreateArray(EltTys);
DBuilder.replaceArrays(FwdDecl, Elements);
if (FwdDecl->isTemporary())
@@ -1662,9 +1664,9 @@ llvm::MDType *CGDebugInfo::CreateTypeDef
if (ID->getImplementation())
Flags |= llvm::DebugNode::FlagObjcClassComplete;
- llvm::MDCompositeType *RealDecl =
- DBuilder.createStructType(Unit, ID->getName(), DefUnit, Line, Size, Align,
- Flags, nullptr, llvm::DIArray(), RuntimeLang);
+ llvm::MDCompositeType *RealDecl = DBuilder.createStructType(
+ Unit, ID->getName(), DefUnit, Line, Size, Align, Flags, nullptr,
+ llvm::DebugNodeArray(), RuntimeLang);
QualType QTy(Ty, 0);
TypeCache[QTy.getAsOpaquePtr()].reset(RealDecl);
@@ -1785,7 +1787,7 @@ llvm::MDType *CGDebugInfo::CreateTypeDef
EltTys.push_back(FieldTy);
}
- llvm::DIArray Elements = DBuilder.getOrCreateArray(EltTys);
+ llvm::DebugNodeArray Elements = DBuilder.getOrCreateArray(EltTys);
DBuilder.replaceArrays(RealDecl, Elements);
LexicalBlockStack.pop_back();
@@ -1802,7 +1804,7 @@ llvm::MDType *CGDebugInfo::CreateType(co
Count = -1;
llvm::Metadata *Subscript = DBuilder.getOrCreateSubrange(0, Count);
- llvm::DIArray SubscriptArray = DBuilder.getOrCreateArray(Subscript);
+ llvm::DebugNodeArray SubscriptArray = DBuilder.getOrCreateArray(Subscript);
uint64_t Size = CGM.getContext().getTypeSize(Ty);
uint64_t Align = CGM.getContext().getTypeAlign(Ty);
@@ -1856,7 +1858,7 @@ llvm::MDType *CGDebugInfo::CreateType(co
EltTy = Ty->getElementType();
}
- llvm::DIArray SubscriptArray = DBuilder.getOrCreateArray(Subscripts);
+ llvm::DebugNodeArray SubscriptArray = DBuilder.getOrCreateArray(Subscripts);
return DBuilder.createArrayType(Size, Align, getOrCreateType(EltTy, Unit),
SubscriptArray);
@@ -1949,7 +1951,7 @@ llvm::MDType *CGDebugInfo::CreateTypeDef
}
// Return a CompositeType for the enum itself.
- llvm::DIArray EltArray = DBuilder.getOrCreateArray(Enumerators);
+ llvm::DebugNodeArray EltArray = DBuilder.getOrCreateArray(Enumerators);
llvm::MDFile *DefUnit = getOrCreateFile(ED->getLocation());
unsigned Line = getLineNumber(ED->getLocation());
@@ -2194,7 +2196,7 @@ llvm::MDType *CGDebugInfo::getOrCreateLi
// Propagate members from the declaration to the definition
// CreateType(const RecordType*) will overwrite this with the members in the
// correct order if the full type is needed.
- DBuilder.replaceArrays(Res, T ? T->getElements() : llvm::DIArray());
+ DBuilder.replaceArrays(Res, T ? T->getElements() : llvm::DebugNodeArray());
// And update the type cache.
TypeCache[QTy.getAsOpaquePtr()].reset(Res);
@@ -2240,7 +2242,7 @@ llvm::MDCompositeType *CGDebugInfo::Crea
if (const ClassTemplateSpecializationDecl *TSpecial =
dyn_cast<ClassTemplateSpecializationDecl>(RD))
- DBuilder.replaceArrays(RealDecl, llvm::DIArray(),
+ DBuilder.replaceArrays(RealDecl, llvm::DebugNodeArray(),
CollectCXXTemplateParams(TSpecial, DefUnit));
return RealDecl;
}
@@ -2281,9 +2283,12 @@ llvm::MDType *CGDebugInfo::CreateMemberT
return Ty;
}
-void CGDebugInfo::collectFunctionDeclProps(
- GlobalDecl GD, llvm::MDFile *Unit, StringRef &Name, StringRef &LinkageName,
- llvm::MDScope *&FDContext, llvm::DIArray &TParamsArray, unsigned &Flags) {
+void CGDebugInfo::collectFunctionDeclProps(GlobalDecl GD, llvm::MDFile *Unit,
+ StringRef &Name,
+ StringRef &LinkageName,
+ llvm::MDScope *&FDContext,
+ llvm::DebugNodeArray &TParamsArray,
+ unsigned &Flags) {
const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl());
Name = getFunctionName(FD);
// Use mangled name as linkage name for C/C++ functions.
@@ -2359,7 +2364,7 @@ void CGDebugInfo::collectVarDeclProps(co
llvm::MDSubprogram *
CGDebugInfo::getFunctionForwardDeclaration(const FunctionDecl *FD) {
- llvm::DIArray TParamsArray;
+ llvm::DebugNodeArray TParamsArray;
StringRef Name, LinkageName;
unsigned Flags = 0;
SourceLocation Loc = FD->getLocation();
@@ -2508,7 +2513,7 @@ llvm::MDSubroutineType *CGDebugInfo::get
if (OMethod->isVariadic())
Elts.push_back(DBuilder.createUnspecifiedParameter());
- llvm::DITypeArray EltTypeArray = DBuilder.getOrCreateTypeArray(Elts);
+ llvm::MDTypeRefArray EltTypeArray = DBuilder.getOrCreateTypeArray(Elts);
return DBuilder.createSubroutineType(F, EltTypeArray);
}
@@ -2522,7 +2527,7 @@ llvm::MDSubroutineType *CGDebugInfo::get
for (unsigned i = 0, e = FPT->getNumParams(); i != e; ++i)
EltTys.push_back(getOrCreateType(FPT->getParamType(i), F));
EltTys.push_back(DBuilder.createUnspecifiedParameter());
- llvm::DITypeArray EltTypeArray = DBuilder.getOrCreateTypeArray(EltTys);
+ llvm::MDTypeRefArray EltTypeArray = DBuilder.getOrCreateTypeArray(EltTys);
return DBuilder.createSubroutineType(F, EltTypeArray);
}
@@ -2545,7 +2550,7 @@ void CGDebugInfo::EmitFunctionStart(Glob
unsigned Flags = 0;
llvm::MDFile *Unit = getOrCreateFile(Loc);
llvm::MDScope *FDContext = Unit;
- llvm::DIArray TParamsArray;
+ llvm::DebugNodeArray TParamsArray;
if (!HasDecl) {
// Use llvm function name.
LinkageName = Fn->getName();
@@ -2746,7 +2751,7 @@ llvm::MDType *CGDebugInfo::EmitTypeForVa
EltTys.push_back(FieldTy);
FieldOffset += FieldSize;
- llvm::DIArray Elements = DBuilder.getOrCreateArray(EltTys);
+ llvm::DebugNodeArray Elements = DBuilder.getOrCreateArray(EltTys);
unsigned Flags = llvm::DebugNode::FlagBlockByrefStruct;
@@ -3093,7 +3098,7 @@ void CGDebugInfo::EmitDeclareOfBlockLite
llvm::raw_svector_ostream(typeName) << "__block_literal_"
<< CGM.getUniqueBlockCount();
- llvm::DIArray fieldsArray = DBuilder.getOrCreateArray(fields);
+ llvm::DebugNodeArray fieldsArray = DBuilder.getOrCreateArray(fields);
llvm::MDType *type = DBuilder.createStructType(
tunit, typeName.str(), tunit, line,
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=235412&r1=235411&r2=235412&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Tue Apr 21 15:07:29 2015
@@ -177,12 +177,12 @@ class CGDebugInfo {
SmallVectorImpl<llvm::Metadata *> &EltTys,
llvm::MDType *RecordTy);
- llvm::DIArray CollectTemplateParams(const TemplateParameterList *TPList,
- ArrayRef<TemplateArgument> TAList,
- llvm::MDFile *Unit);
- llvm::DIArray CollectFunctionTemplateParams(const FunctionDecl *FD,
- llvm::MDFile *Unit);
- llvm::DIArray
+ llvm::DebugNodeArray
+ CollectTemplateParams(const TemplateParameterList *TPList,
+ ArrayRef<TemplateArgument> TAList, llvm::MDFile *Unit);
+ llvm::DebugNodeArray CollectFunctionTemplateParams(const FunctionDecl *FD,
+ llvm::MDFile *Unit);
+ llvm::DebugNodeArray
CollectCXXTemplateParams(const ClassTemplateSpecializationDecl *TS,
llvm::MDFile *F);
@@ -421,7 +421,8 @@ private:
void collectFunctionDeclProps(GlobalDecl GD, llvm::MDFile *Unit,
StringRef &Name, StringRef &LinkageName,
llvm::MDScope *&FDContext,
- llvm::DIArray &TParamsArray, unsigned &Flags);
+ llvm::DebugNodeArray &TParamsArray,
+ unsigned &Flags);
/// \brief Collect various properties of a VarDecl.
void collectVarDeclProps(const VarDecl *VD, llvm::MDFile *&Unit,
More information about the cfe-commits
mailing list