[PATCH] D89313: Fix implicit TypeSize casts in EmitCheckValue
Caroline via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 13 06:14:21 PDT 2020
CarolineConcatto created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
CarolineConcatto requested review of this revision.
Using getFixedSize() with:
V->getType()->getPrimitiveSizeInBits()
like this:
V->getType()->getPrimitiveSizeInBits().getFixedSize()
makes the cast from TypeSize to uint64_t explicit.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89313
Files:
clang/lib/CodeGen/CGExpr.cpp
Index: clang/lib/CodeGen/CGExpr.cpp
===================================================================
--- clang/lib/CodeGen/CGExpr.cpp
+++ clang/lib/CodeGen/CGExpr.cpp
@@ -2988,7 +2988,7 @@
// Floating-point types which fit into intptr_t are bitcast to integers
// and then passed directly (after zero-extension, if necessary).
if (V->getType()->isFloatingPointTy()) {
- unsigned Bits = V->getType()->getPrimitiveSizeInBits();
+ unsigned Bits = V->getType()->getPrimitiveSizeInBits().getFixedSize();
if (Bits <= TargetTy->getIntegerBitWidth())
V = Builder.CreateBitCast(V, llvm::Type::getIntNTy(getLLVMContext(),
Bits));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89313.297839.patch
Type: text/x-patch
Size: 708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201013/61590774/attachment.bin>
More information about the cfe-commits
mailing list