diff options
author | Nikita Popov <npopov@redhat.com> | 2021-12-20 16:17:27 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2021-12-21 14:16:28 +0100 |
commit | e751d97863fb48b7dd844e48c0ba564f6970b726 (patch) | |
tree | f237016aca7bf7704c05b71103d219f4c7195108 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | f2f6d09185d6310317cc2bfcc01948a0e42cc081 (diff) | |
download | llvm-e751d97863fb48b7dd844e48c0ba564f6970b726.zip llvm-e751d97863fb48b7dd844e48c0ba564f6970b726.tar.gz llvm-e751d97863fb48b7dd844e48c0ba564f6970b726.tar.bz2 |
[CodeGen] Avoid some pointer element type accesses
This avoids some pointer element type accesses when compiling
C++ code.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 702495df..b437ba0 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -200,7 +200,8 @@ CodeGenFunction::MakeNaturalAlignPointeeAddrLValue(llvm::Value *V, QualType T) { TBAAAccessInfo TBAAInfo; CharUnits Align = CGM.getNaturalTypeAlignment(T, &BaseInfo, &TBAAInfo, /* forPointeeType= */ true); - return MakeAddrLValue(Address(V, Align), T, BaseInfo, TBAAInfo); + Address Addr(V, ConvertTypeForMem(T), Align); + return MakeAddrLValue(Addr, T, BaseInfo, TBAAInfo); } |