[llvm-commits] [llvm-gcc-4.2] r129931 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Jay Foad
jay.foad at gmail.com
Thu Apr 21 12:59:26 PDT 2011
Author: foad
Date: Thu Apr 21 14:59:26 2011
New Revision: 129931
URL: http://llvm.org/viewvc/llvm-project?rev=129931&view=rev
Log:
PR9214: Convert Metadata API to use ArrayRef.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=129931&r1=129930&r2=129931&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Thu Apr 21 14:59:26 2011
@@ -1486,11 +1486,11 @@
DIArray DIFactory::GetOrCreateArray(DIDescriptor *Tys, unsigned NumTys) {
if (NumTys == 0) {
Value *Null = llvm::Constant::getNullValue(Type::getInt32Ty(VMContext));
- return DIArray(MDNode::get(VMContext, &Null, 1));
+ return DIArray(MDNode::get(VMContext, Null));
}
SmallVector<Value *, 16> Elts(Tys, Tys+NumTys);
- return DIArray(MDNode::get(VMContext, Elts.data(), Elts.size()));
+ return DIArray(MDNode::get(VMContext, Elts));
}
/// GetOrCreateSubrange - Create a descriptor for a value range. This
@@ -1502,7 +1502,7 @@
ConstantInt::get(Type::getInt64Ty(VMContext), Hi)
};
- return DISubrange(MDNode::get(VMContext, &Elts[0], 3));
+ return DISubrange(MDNode::get(VMContext, Elts));
}
/// CreateUnspecifiedParameter - Create unspeicified type descriptor
@@ -1511,7 +1511,7 @@
Value *Elts[] = {
GetTagConstant(dwarf::DW_TAG_unspecified_parameters)
};
- return DIDescriptor(MDNode::get(VMContext, &Elts[0], 1));
+ return DIDescriptor(MDNode::get(VMContext, Elts));
}
/// CreateCompileUnit - Create a new descriptor for the specified compile
@@ -1537,7 +1537,7 @@
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeVer)
};
- return DICompileUnit(MDNode::get(VMContext, &Elts[0], 10));
+ return DICompileUnit(MDNode::get(VMContext, Elts));
}
/// CreateFile - Create a new descriptor for the specified file.
@@ -1551,7 +1551,7 @@
CU
};
- return DIFile(MDNode::get(VMContext, &Elts[0], 4));
+ return DIFile(MDNode::get(VMContext, Elts));
}
/// CreateEnumerator - Create a single enumerator value.
@@ -1561,7 +1561,7 @@
MDString::get(VMContext, Name),
ConstantInt::get(Type::getInt64Ty(VMContext), Val)
};
- return DIEnumerator(MDNode::get(VMContext, &Elts[0], 3));
+ return DIEnumerator(MDNode::get(VMContext, Elts));
}
@@ -1586,7 +1586,7 @@
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
ConstantInt::get(Type::getInt32Ty(VMContext), Encoding)
};
- return DIBasicType(MDNode::get(VMContext, &Elts[0], 10));
+ return DIBasicType(MDNode::get(VMContext, Elts));
}
@@ -1611,7 +1611,7 @@
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
ConstantInt::get(Type::getInt32Ty(VMContext), Encoding)
};
- return DIBasicType(MDNode::get(VMContext, &Elts[0], 10));
+ return DIBasicType(MDNode::get(VMContext, Elts));
}
/// CreateArtificialType - Create a new DIType with "artificial" flag set.
@@ -1635,7 +1635,7 @@
// Flags are stored at this slot.
Elts[8] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags);
- return DIType(MDNode::get(VMContext, Elts.data(), Elts.size()));
+ return DIType(MDNode::get(VMContext, Elts));
}
/// CreateDerivedType - Create a derived type like const qualified type,
@@ -1662,7 +1662,7 @@
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
DerivedFrom,
};
- return DIDerivedType(MDNode::get(VMContext, &Elts[0], 10));
+ return DIDerivedType(MDNode::get(VMContext, Elts));
}
@@ -1690,7 +1690,7 @@
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
DerivedFrom,
};
- return DIDerivedType(MDNode::get(VMContext, &Elts[0], 10));
+ return DIDerivedType(MDNode::get(VMContext, Elts));
}
@@ -1725,7 +1725,7 @@
ContainingType
};
- MDNode *Node = MDNode::get(VMContext, &Elts[0], 13);
+ MDNode *Node = MDNode::get(VMContext, Elts);
// Create a named metadata so that we do not lose this enum info.
if (Tag == dwarf::DW_TAG_enumeration_type) {
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.enum");
@@ -1741,7 +1741,7 @@
Value *Elts[] = {
GetTagConstant(DW_TAG_base_type)
};
- MDNode *Node = MDNode::getTemporary(VMContext, Elts, array_lengthof(Elts));
+ MDNode *Node = MDNode::getTemporary(VMContext, Elts);
return DIType(Node);
}
@@ -1755,7 +1755,7 @@
NULL,
F
};
- MDNode *Node = MDNode::getTemporary(VMContext, Elts, array_lengthof(Elts));
+ MDNode *Node = MDNode::getTemporary(VMContext, Elts);
return DIType(Node);
}
@@ -1788,7 +1788,7 @@
ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang),
ContainingType
};
- MDNode *Node = MDNode::get(VMContext, &Elts[0], 13);
+ MDNode *Node = MDNode::get(VMContext, Elts);
// Create a named metadata so that we do not lose this enum info.
if (Tag == dwarf::DW_TAG_enumeration_type) {
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.enum");
@@ -1834,7 +1834,7 @@
ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized),
Fn
};
- MDNode *Node = MDNode::get(VMContext, &Elts[0], 17);
+ MDNode *Node = MDNode::get(VMContext, Elts);
// Create a named metadata so that we do not lose this mdnode.
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.sp");
@@ -1868,7 +1868,7 @@
DeclNode->getOperand(15), // isOptimized
SPDeclaration.getFunction()
};
- MDNode *Node =MDNode::get(VMContext, &Elts[0], 16);
+ MDNode *Node =MDNode::get(VMContext, Elts);
// Create a named metadata so that we do not lose this mdnode.
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.sp");
@@ -1899,8 +1899,7 @@
Val
};
- Value *const *Vs = &Elts[0];
- MDNode *Node = MDNode::get(VMContext,Vs, 12);
+ MDNode *Node = MDNode::get(VMContext, Elts);
// Create a named metadata so that we do not lose this mdnode.
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.gv");
@@ -1932,8 +1931,7 @@
Val
};
- Value *const *Vs = &Elts[0];
- MDNode *Node = MDNode::get(VMContext,Vs, 12);
+ MDNode *Node = MDNode::get(VMContext, Elts);
// Create a named metadata so that we do not lose this mdnode.
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.gv");
@@ -1958,7 +1956,7 @@
Ty,
ConstantInt::get(Type::getInt32Ty(VMContext), Flags)
};
- MDNode *Node = MDNode::get(VMContext, &Elts[0], 7);
+ MDNode *Node = MDNode::get(VMContext, Elts);
if (AlwaysPreserve) {
// The optimizer may remove local variable. If there is an interest
// to preserve variable info in such situation then stash it in a
@@ -1995,7 +1993,7 @@
Elts.push_back(Ty);
Elts.append(Addr, Addr+NumAddr);
- return DIVariable(MDNode::get(VMContext, Elts.data(), Elts.size()));
+ return DIVariable(MDNode::get(VMContext, Elts));
}
@@ -2014,7 +2012,7 @@
F,
ConstantInt::get(Type::getInt32Ty(VMContext), unique_id++)
};
- return DILexicalBlock(MDNode::get(VMContext, &Elts[0], 6));
+ return DILexicalBlock(MDNode::get(VMContext, Elts));
}
/// CreateNameSpace - This creates new descriptor for a namespace
@@ -2029,7 +2027,7 @@
F,
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo)
};
- return DINameSpace(MDNode::get(VMContext, &Elts[0], 5));
+ return DINameSpace(MDNode::get(VMContext, Elts));
}
/// CreateLocation - Creates a debug info location.
@@ -2041,7 +2039,7 @@
S,
OrigLoc,
};
- return DILocation(MDNode::get(VMContext, &Elts[0], 4));
+ return DILocation(MDNode::get(VMContext, Elts));
}
//===----------------------------------------------------------------------===//
@@ -2056,7 +2054,7 @@
if (!DeclareFn)
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
- Value *Args[] = { MDNode::get(Storage->getContext(), &Storage, 1),
+ Value *Args[] = { MDNode::get(Storage->getContext(), Storage),
D };
return CallInst::Create(DeclareFn, Args, Args+2, "", InsertBefore);
}
@@ -2069,7 +2067,7 @@
if (!DeclareFn)
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
- Value *Args[] = { MDNode::get(Storage->getContext(), &Storage, 1),
+ Value *Args[] = { MDNode::get(Storage->getContext(), Storage),
D };
// If this block already has a terminator then insert this intrinsic
@@ -2088,7 +2086,7 @@
if (!ValueFn)
ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);
- Value *Args[] = { MDNode::get(V->getContext(), &V, 1),
+ Value *Args[] = { MDNode::get(V->getContext(), V),
ConstantInt::get(Type::getInt64Ty(V->getContext()), Offset),
D };
return CallInst::Create(ValueFn, Args, Args+3, "", InsertBefore);
@@ -2103,7 +2101,7 @@
if (!ValueFn)
ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);
- Value *Args[] = { MDNode::get(V->getContext(), &V, 1),
+ Value *Args[] = { MDNode::get(V->getContext(), V),
ConstantInt::get(Type::getInt64Ty(V->getContext()), Offset),
D };
return CallInst::Create(ValueFn, Args, Args+3, "", InsertAtEnd);
More information about the llvm-commits
mailing list