aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2021-12-24 14:01:54 +0100
committerNikita Popov <npopov@redhat.com>2021-12-27 12:00:22 +0100
commit1f07a4a5699b73582461880e716e6692cbe3d6a6 (patch)
tree511c925a91d9617fd563f806147b9ade01f566aa /clang/lib/CodeGen/CodeGenFunction.h
parent2e630eabd32989d9ef31472d9470dc577a0d77e4 (diff)
downloadllvm-1f07a4a5699b73582461880e716e6692cbe3d6a6.zip
llvm-1f07a4a5699b73582461880e716e6692cbe3d6a6.tar.gz
llvm-1f07a4a5699b73582461880e716e6692cbe3d6a6.tar.bz2
[CodeGen] Avoid more pointer element type accesses
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index f76ce8a..ece863a 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -182,6 +182,7 @@ template <> struct DominatingValue<Address> {
struct saved_type {
DominatingLLVMValue::saved_type SavedValue;
+ llvm::Type *ElementType;
CharUnits Alignment;
};
@@ -190,11 +191,11 @@ template <> struct DominatingValue<Address> {
}
static saved_type save(CodeGenFunction &CGF, type value) {
return { DominatingLLVMValue::save(CGF, value.getPointer()),
- value.getAlignment() };
+ value.getElementType(), value.getAlignment() };
}
static type restore(CodeGenFunction &CGF, saved_type value) {
return Address(DominatingLLVMValue::restore(CGF, value.SavedValue),
- value.Alignment);
+ value.ElementType, value.Alignment);
}
};