Update to match mainline ConstantStruct::get API change. Also, use
ConvertType on InitListExprs as they are being converted. This is
needed for a forthcoming patch, and improves the IR generated anyway
(see additional type names in testcases).
This patch also converts a bunch of std::vector's in CGObjCMac to use
C arrays. There are a ton more that should be converted as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133413 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp
index 77320c7..9edd793 100644
--- a/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/lib/CodeGen/ItaniumCXXABI.cpp
@@ -472,8 +472,7 @@
else
Values[1] = llvm::ConstantExpr::getAdd(CS->getOperand(1), Offset);
- return llvm::ConstantStruct::get(CGM.getLLVMContext(), Values, 2,
- /*Packed=*/false);
+ return llvm::ConstantStruct::get(CS->getType(), Values);
}
@@ -488,8 +487,7 @@
llvm::Constant *Zero = llvm::ConstantInt::get(ptrdiff_t, 0);
llvm::Constant *Values[2] = { Zero, Zero };
- return llvm::ConstantStruct::get(CGM.getLLVMContext(), Values, 2,
- /*Packed=*/false);
+ return llvm::ConstantStruct::getAnon(Values);
}
llvm::Constant *
@@ -554,8 +552,7 @@
MemPtr[1] = llvm::ConstantInt::get(ptrdiff_t, 0);
}
- return llvm::ConstantStruct::get(CGM.getLLVMContext(),
- MemPtr, 2, /*Packed=*/false);
+ return llvm::ConstantStruct::getAnon(MemPtr);
}
/// The comparison algorithm is pretty easy: the member pointers are