aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2008-06-04 16:14:12 +0000
committerMatthijs Kooijman <matthijs@stdin.nl>2008-06-04 16:14:12 +0000
commit338169ddc9bb4061f248d0afbf0ec87b6bf2227d (patch)
treefc887fa7d440c16d6c531fb1d811d77079bce07a /lib
parent61399af13fd46fe1be85807ae1d595b1b9ff62cf (diff)
downloadexternal_llvm-338169ddc9bb4061f248d0afbf0ec87b6bf2227d.zip
external_llvm-338169ddc9bb4061f248d0afbf0ec87b6bf2227d.tar.gz
external_llvm-338169ddc9bb4061f248d0afbf0ec87b6bf2227d.tar.bz2
Add a Name parameter to two of the init methods of GetElementPointer to make the name setting more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51945 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Instructions.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 6da04e7..3fb1c61 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -992,20 +992,24 @@ static unsigned retrieveAddrSpace(const Value *Val) {
return cast<PointerType>(Val->getType())->getAddressSpace();
}
-void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx) {
+void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx, const std::string &Name) {
assert(NumOperands == 1+NumIdx && "NumOperands not initialized?");
Use *OL = OperandList;
OL[0] = Ptr;
for (unsigned i = 0; i != NumIdx; ++i)
OL[i+1] = Idx[i];
+
+ setName(Name);
}
-void GetElementPtrInst::init(Value *Ptr, Value *Idx) {
+void GetElementPtrInst::init(Value *Ptr, Value *Idx, const std::string &Name) {
assert(NumOperands == 2 && "NumOperands not initialized?");
Use *OL = OperandList;
OL[0] = Ptr;
OL[1] = Idx;
+
+ setName(Name);
}
GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI)
@@ -1026,8 +1030,7 @@ GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
GetElementPtr,
OperandTraits<GetElementPtrInst>::op_end(this) - 2,
2, InBe) {
- init(Ptr, Idx);
- setName(Name);
+ init(Ptr, Idx, Name);
}
GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
@@ -1037,8 +1040,7 @@ GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
GetElementPtr,
OperandTraits<GetElementPtrInst>::op_end(this) - 2,
2, IAE) {
- init(Ptr, Idx);
- setName(Name);
+ init(Ptr, Idx, Name);
}
// getIndexedType - Returns the type of the element that would be loaded with