[PATCH] D16418: [opaque pointer types] [NFC] Add an explicit type argument to ConstantFoldLoadFromConstPtr.

Eduard Burtescu via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 17:10:24 PST 2016


eddyb added inline comments.

================
Comment at: lib/Analysis/ConstantFolding.cpp:488
@@ -485,3 +487,3 @@
     return nullptr;
-  Type *DestTy = DestPtrTy->getElementType();
+  Type *SrcTy = SrcPtrTy->getPointerElementType();
 
----------------
dblaikie wrote:
> Presumably this could be getElementType (since SrcPtrTy is already a PointerType) - but in either case this is a stop-gap and will eventually be removed/migrated?
I've been using `getPointerElementType` everywhere so it matches my local setup where `PointerType::getPointerElementType` is the only method used everywhere (the one on `Value` is gone and `PointerType::getElementType` is deprecated).


http://reviews.llvm.org/D16418





More information about the llvm-commits mailing list