[clang] acc3987 - [CodeGen] Avoid deprecated Address constructor

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 11 04:07:11 PST 2022


Author: Nikita Popov
Date: 2022-01-11T13:07:02+01:00
New Revision: acc39873b70eae53a0c32ca5073f08ea55bbab1c

URL: https://github.com/llvm/llvm-project/commit/acc39873b70eae53a0c32ca5073f08ea55bbab1c
DIFF: https://github.com/llvm/llvm-project/commit/acc39873b70eae53a0c32ca5073f08ea55bbab1c.diff

LOG: [CodeGen] Avoid deprecated Address constructor

Added: 
    

Modified: 
    clang/lib/CodeGen/CodeGenFunction.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 2d3b214ca424..640c73f1a556 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -2109,6 +2109,7 @@ llvm::Value *CodeGenFunction::emitArrayLength(const ArrayType *origArrayType,
     // Create the actual GEP.
     addr = Address(Builder.CreateInBoundsGEP(
         addr.getElementType(), addr.getPointer(), gepIndices, "array.begin"),
+        ConvertTypeForMem(eltType),
         addr.getAlignment());
   }
 


        


More information about the cfe-commits mailing list