From 62df5eed16a07c4dd183c71d69d6858b5fa19652 Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Thu, 10 Jan 2019 16:07:20 +0000 Subject: [opaque pointer types] Remove some calls to generic Type subtype accessors. That is, remove many of the calls to Type::getNumContainedTypes(), Type::subtypes(), and Type::getContainedType(N). I'm not intending to remove these accessors -- they are useful/necessary in some cases. However, removing the pointee type from pointers would potentially break some uses, and reducing the number of calls makes it easier to audit. llvm-svn: 350835 --- llvm/lib/IR/Constants.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/IR/Constants.cpp') diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index df09d13d3eb..d36967fdcfe 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -1999,9 +1999,8 @@ Constant *ConstantExpr::getGetElementPtr(Type *Ty, Constant *C, if (!Ty) Ty = cast(C->getType()->getScalarType())->getElementType(); else - assert( - Ty == - cast(C->getType()->getScalarType())->getContainedType(0u)); + assert(Ty == + cast(C->getType()->getScalarType())->getElementType()); if (Constant *FC = ConstantFoldGetElementPtr(Ty, C, InBounds, InRangeIndex, Idxs)) -- cgit v1.2.3