craig.topper added inline comments.

================
Comment at: clang/lib/CodeGen/Address.h:31
+      : Address(pointer, nullptr, alignment) {}
+  Address(llvm::Value *pointer, llvm::Type *PointeeType, CharUnits alignment)
+      : Pointer(pointer), PointeeType(PointeeType), Alignment(alignment) {
----------------
Is PointeeType expected to be non-null when pointer is non-null?


================
Comment at: clang/lib/CodeGen/Address.h:58
   /// store it in Address instead for the convenience of writing code.
-  llvm::Type *getElementType() const {
-    return getType()->getElementType();
-  }
+  llvm::Type *getElementType() const { return PointeeType; }
 
----------------
Should this assert isValid() since it no longer goes through getType() and 
getPointer() which would have asserted previously?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103465/new/

https://reviews.llvm.org/D103465

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to